-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Accept index in addition to list for set_index #10797
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
Comments
So you want this?
yeh, its a pretty trivial change. want to take a go at it. Appears innocuous. |
change here to |
Yep, exactly. |
It's valid to pass an Index or row labels to |
Hi, can I take a go at this? |
I came across what is essentially the same issue in 2023: I wanted to pass an instance of
The check in Lines 5787 to 5788 in 01693d6
It seems to be a simple one-liner. However, in 2015 Pinging @jreback |
Running this code generates an error, since columns are now considered an Index and not a list. I'm not sure if the error that gets raised (set_index ends up asking for an index that is the entire length of the data frame) is actually by design. In this case, it was a bit unintuitive to figure out how to catch, since Index objects and python lists often work so similarly.
The text was updated successfully, but these errors were encountered: