Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Groupby all levels except the specified ones #15475
I was thinking if it would be useful to add a parameter to the groupby function (e.g. allbut=True) so that pandas will group all levels except the specified ones) .
I suggest so because in a multilevel index with several levels, eliminating just one level requires a quite verbose approach
Actually this would be quite trivial to implement. We currently support a union (set ops) for
This might break other things, so need some tests. Also would be nice to support intersection,