From 74525b3711ebcd73310a70f93c25b413e172de55 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 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pandas/core/series.py b/pandas/core/series.py index 8ddce3d5cab26d..fea6346dd6a152 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -5004,6 +5004,43 @@ def reindex( # type: ignore[override] tolerance=tolerance, ) + + @overload + def rename_axis( # type: ignore[override] + self, + mapper: ..., + *, + index = ..., + axis: Axis = ..., + copy: bool = ..., + inplace: bool = Literal[True], + ) -> None: + ... + + @overload + def rename_axis( # type: ignore[override] + self, + mapper: ..., + *, + index = ..., + axis: Axis = ..., + copy: bool = ..., + inplace: bool = Literal[False], + ) -> Self: + ... + + @overload + def rename_axis( # type: ignore[override] + self, + mapper: ..., + *, + index = ..., + axis: Axis = ..., + copy: bool = ..., + inplace: bool = ..., + ) -> Self | None: + ... + @doc(NDFrame.rename_axis) def rename_axis( # type: ignore[override] self,