-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Series.rename treats Series as list-like instead of mapping #12623
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
Indexes are NOT dict_like though (Series ARE). so something else happening.
|
Ah.... my bad. I thought I didn't reproduce it with a non-RangeIndexed series, but I must have been mistaken. In [52]: s.rename(pd.Series({'a': 'A', 'b': 'B'}))
Out[52]:
a 0
b 1
Name: [A, B], dtype: int64 I'll update. |
somewhat related to #12610 (IOW setting the |
Updated, can't believe I missed this. Will have a fix tonight. |
Closes pandas-dev#12623 I added com.is_dict_like in pandas-dev#11980 and failed to use it for the `rename` method. Using that now and did some refactoring while I was in there. Added more tests for rename.
Problem is here using an
isinstance(,MutableMapping)
instead ofcom.is_dict_like
.rename_axis
should be fine, but will add tests for both.The text was updated successfully, but these errors were encountered: