Skip to content

BUG: Series.rename treats Series as list-like instead of mapping #12623

Closed
@TomAugspurger

Description

@TomAugspurger
#### Code Sample, a copy-pastable example if possible

In [6]: s = pd.Series([0, 1])

In [5]: s.rename(pd.Series({0: 10, 1: 20}))
Out[5]:
0    0
1    1
Name: [10, 20], dtype: int64

Problem is here using an isinstance(,MutableMapping) instead of com.is_dict_like. rename_axis should be fine, but will add tests for both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions