API: inconsistencies between grouped and grouped[['col']] in groupby #21790
Labels
API - Consistency
Internal Consistency of API/Behavior
Bug
Closing Candidate
May be closeable, needs more eyeballs
Groupby
One a DataFrameGroupBy object, you can already select some of the columns you want to apply your functions on, but apart from that, I would not expect it to influence the output structure:
So in the above, doing
gr[['C', 'B']]
causes the final result not to have the MultiIndex, which IMO is very surprising.The above example if for a deprecated case, so not sure how important it is (didn't directly see a similar case for a non-deprecated call), but when we clean-up the deprecations, we should certainly check this.
cc @jreback @WillAyd
The text was updated successfully, but these errors were encountered: