From 540d5e2c749c08944d75d5d59ec9a9a60fd6bdcf Mon Sep 17 00:00:00 2001 From: Christopher Neffshade Date: Thu, 5 Oct 2023 14:15:49 +0000 Subject: [PATCH] Add overload for rename_axis --- pandas/core/series.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pandas/core/series.py b/pandas/core/series.py index 8ddce3d5cab26..c734d0f375cc8 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -5004,6 +5004,42 @@ def reindex( # type: ignore[override] tolerance=tolerance, ) + @overload + def rename_axis( # type: ignore[override] + self, + mapper: IndexLabel | lib.NoDefault = ..., + *, + index = ..., + axis: Axis = ..., + copy: bool = ..., + inplace: Literal[True], + ) -> None: + ... + + @overload + def rename_axis( # type: ignore[override] + self, + mapper: IndexLabel | lib.NoDefault = ..., + *, + index = ..., + axis: Axis = ..., + copy: bool = ..., + inplace: Literal[False] = ..., + ) -> Self: + ... + + @overload + def rename_axis( # type: ignore[override] + self, + mapper: IndexLabel | lib.NoDefault = ..., + *, + index = ..., + axis: Axis = ..., + copy: bool = ..., + inplace: bool = ..., + ) -> Self | None: + ... + @doc(NDFrame.rename_axis) def rename_axis( # type: ignore[override] self,