Skip to content

BUG: unstack() sorts automatically, default is preferably unsorted? #34112

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

Closed
MatthiVH opened this issue May 11, 2020 · 2 comments
Closed

BUG: unstack() sorts automatically, default is preferably unsorted? #34112

MatthiVH opened this issue May 11, 2020 · 2 comments
Labels
Bug Duplicate Report Duplicate issue or pull request Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Comments

@MatthiVH
Copy link

The unstack() function is automatically sorting my labels in my boxplot-code. Isn't it nice to have a sort = False option (probably the default?)

My labels are perfectly ordered, it's just after unstacking they get messed-up.

my post on stack-overflow: https://stackoverflow.com/questions/61720090/issues-with-boxplot-figure-x-label-are-alphabetically-and-extra-nan-label-is-cr

another example: https://stackoverflow.com/questions/32163063/pandas-plotting-incorrectly-sorts-the-binned-values-on-the-graph

@MatthiVH MatthiVH added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 11, 2020
@MarcoGorelli
Copy link
Member

Thanks @MatthiVH for the report

So, this is a feature request for sort in unstack? If so, seems it's a duplicate of #15105, so I'll close it (but feel free to reopen if you disagree that it's a duplicate)

@MatthiVH
Copy link
Author

Oh yeah sure, didn't see that this suggestion was already there for a long time.
Now I see, yes then it's a duplicate!

@simonjayhawkins simonjayhawkins added Duplicate Report Duplicate issue or pull request Reshaping Concat, Merge/Join, Stack/Unstack, Explode and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

No branches or pull requests

3 participants