We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How do I change the names of the various levels on a MultiIndex? How do I do so NOT in place (i.e returning a new Dataframe)?
For example I have:
d1 d2 d3 d4 u1 u2 u3 Good Things C 1 1 1 1 R 1 1 1 1 Bad Things C 1 1 1 1 T 1 1 1 1 Okay Things N B 1 1 1 1 D 1 1 1 1 B 1 1 1 1 D 1 1 1 1
and I want to change the u1, u2, u3.
Currently I can change the names in place using:
df.index.names = ['a1', 'a2', 'a3']
The text was updated successfully, but these errors were encountered:
Copy the dataframe, then set names.
Sorry, something went wrong.
If you want to get a new dataframe, it has to copy all the underlying data anyways...
Yea, I was just wondering if there was something like swaplevel or reorder_levels that did the copy, etc for me.
dupe of #4160
No branches or pull requests
How do I change the names of the various levels on a MultiIndex? How do I do so NOT in place (i.e returning a new Dataframe)?
For example I have:
and I want to change the u1, u2, u3.
Currently I can change the names in place using:
The text was updated successfully, but these errors were encountered: