Skip to content
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

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

Open
loicdiridollou opened this issue Mar 2, 2025 · 0 comments · May be fixed by #1140
Open

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

loicdiridollou opened this issue Mar 2, 2025 · 0 comments · May be fixed by #1140

Comments

@loicdiridollou
Copy link
Contributor

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
@loicdiridollou loicdiridollou linked a pull request Mar 2, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant