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

GH60942 Update docs and overload for Series.rename #60975

Merged
merged 4 commits into from
Feb 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4651,7 +4651,7 @@ def rename(
inplace: Literal[True],
level: Level | None = ...,
errors: IgnoreRaise = ...,
) -> None: ...
) -> Series | None: ...

@overload
def rename(
Expand All @@ -4665,18 +4665,6 @@ def rename(
errors: IgnoreRaise = ...,
) -> Series: ...

@overload
def rename(
self,
index: Renamer | Hashable | None = ...,
*,
axis: Axis | None = ...,
copy: bool | lib.NoDefault = ...,
inplace: bool = ...,
level: Level | None = ...,
errors: IgnoreRaise = ...,
) -> Series | None: ...

def rename(
self,
index: Renamer | Hashable | None = None,
Expand Down Expand Up @@ -4734,8 +4722,9 @@ def rename(

Returns
-------
Series or None
Series with index labels or name altered or None if ``inplace=True``.
Series
A shallow copy with index labels or name altered, or the same object
if ``inplace=True`` and index is not a dict or callable else None.

See Also
--------
Expand Down