-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
sort_index
does not work with levels not aligned with index
#25775
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
Labels
Milestone
Comments
Hmm that does look strange - thanks for the report! Investigation and PRs are always welcome |
I get the expected output at the current master. |
@mahepe great! would u do a PR with a validation test |
sure @jreback, will take some days due to work though |
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 22, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 22, 2019
4 tasks
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 25, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 25, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 26, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 26, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 26, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
May 29, 2019
mahepe
pushed a commit
to mahepe/pandas
that referenced
this issue
Jun 3, 2019
jreback
pushed a commit
that referenced
this issue
Jun 5, 2019
vaibhavhrt
pushed a commit
to vaibhavhrt/pandas
that referenced
this issue
Jun 6, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
Problem description
I don't understand why the a index is not sorted (see the b=7 rows).
Indeed,
set_index
does not seem to take into account levels not aligned with dataframe indexes. Since index is['a', 'b', 'c']
it can only sort withlevels=['a'], levels=['a', 'b'], levels=['a', 'b', 'c'], levels=['b'], levels=['b', 'c'], levels=['c']
.Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
Note: Many problems can be resolved by simply upgrading
pandas
to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check ifmaster
addresses this issue, but that is not necessary.For documentation-related issues, you can check the latest versions of the docs on
master
here:https://pandas-docs.github.io/pandas-docs-travis/
If the issue has not been resolved there, go ahead and file it in the issue tracker.
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: