Skip to content

Series().rename(..., inplace=True) can return a Series if the renamer is hashable #1139

Closed
@loicdiridollou

Description

@loicdiridollou

Series.rename inplace can actually return Self and not None see pandas-dev/pandas#60942
The current typehinting would force it to be None but at runtime this does not seem to stand.

>>> import pandas as pd
>>> pd.Series([1, 2, 3]).rename("A", inplace=True)
0    1
1    2
2    3
Name: A, dtype: int64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions