You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems the name of the index is gone after rename for both Series and DataFrame
In [1]: import pandas as pd
In [2]: sr = pd.Series([1, 2, 3], pd.Index(['a', 'b', 'c'], name='test'))
In [3]: sr
Out[4]:
test
a 1
b 2
c 3
In [4]: sr.rename({'a': 'd'})
Out[4]:
d 1
b 2
c 3
When trying to rename something in a MultiIndex it doesn't work and flattens the index:
Taken from this SO question.
The text was updated successfully, but these errors were encountered: