-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: groupby with categorical result order differs for index type #49223
Comments
@rhshadrach Is this the intended behaviour?
I.e. The sort order of the values only depends on the sort argument in both cases. |
I think this is correct - but the example in your post depends on
|
Perhaps the above expectation of how
Somewhat related discussion: #12785 |
In that case, does it make sense for E.g.
|
@gt-on-1234 - yes, I think so. That we should sort by that data's natural order when |
When a categorical grouper is used on a DataFrame with a range index, the sort order of the values depends only on whether the categorical is ordered. When the grouper is the index, the sort order of the values depends only on the
sort
argument to groupby.Code
The text was updated successfully, but these errors were encountered: