BUG: groupby.rolling.corr incorrect/fails when grouping columns contain tuples #44078
Labels
cov/corr
Groupby
Needs Tests
Unit test(s) needed to prevent regressions
Window
rolling, ewma, expanding
Milestone
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
The first block produces
where the first index level should be
(1, )
instead. The second block raises a ValueError. It is due to usage of maybe_make_list in _apply_pairwise (related: #44056). Instead of using this function, we can pack the index keys in lists whenself._grouper.nkeys
is 1 and otherwise leave them as-is. I.e.Expected Behavior
Installed Versions
Replace this line with the output of pd.show_versions()
The text was updated successfully, but these errors were encountered: