-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ordered Groupby Keys #757
Comments
I agree this is annoying, but I don't think your diagnosis is correct here. The |
Hmmm, a mystery. I'll look into this a bit more. |
For what it's worth, I don't think we have any good solutions short of |
Ahh, so it's sorted, instead of keeping the original order. I was expecting |
Just stumbled across this issue. Is there a recommended workaround? I am usually doing this (specific to seasons):
Thought this might help some folks who need to solve this problem. |
I use |
Closing as stale, please reopen with an updated summary if relevant |
Hehe, I'm so close to actually fixing this! :) |
Closes pydata#757 Closes pydata#2852
The current behavior of the xarray's
Groupby.groups
property provides a standard (unordered) dictionary. This is fine for most cases but leads to odd orderings in use cases like this one where I am using xarray's FacetGrid plotting:Note that MAM and JJA are out of order.
I think this could be easily fixed by using an
OrderedDict
inxarray.core.Groupby.groups
.The text was updated successfully, but these errors were encountered: