-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
sort_index throws IndexError for some permutations #26053
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
Please provide fully reproducible code - it's not clear what |
## a -> df
import pandas as pd
df = pd.DataFrame(list(range(8)))
df.index = pd.MultiIndex.from_product([[0,1]]*3)
df.sort_index(level=[1,2,0]) |
OK thanks for clarifying. The both seem to fail: df.sort_index(level=[2,1,0])
df.sort_index(level=[1,2,0])
May or may not be related to issue - in any case investigation and PRs are always welcome! |
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 11, 2019
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 11, 2019
…6053) - (lev - i) will be negative if 0th index is at the end of level list
3 tasks
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 14, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 16, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 16, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 21, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 21, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 23, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jayanthkaturi
added a commit
to jayanthkaturi/pandas
that referenced
this issue
Apr 24, 2019
…6053) - (lev - i) will be out of bounds for pop if the first index dim is to be sorted last
jreback
pushed a commit
that referenced
this issue
Apr 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample
Problem description
This throws an
IndexEror: pop index out of range
.If I change the order to
[2,0,1]
, it doesn't.python: 3.6.6.final.0
pandas: 0.24.2
numpy: 1.15.4
The text was updated successfully, but these errors were encountered: