78
78
from pandas .core .strings import StringMethods
79
79
from pandas .core .tools .datetimes import to_datetime
80
80
81
- from pandas ._typing import Level
81
+ from pandas ._typing import Axis , Level
82
82
import pandas .io .formats .format as fmt
83
83
import pandas .plotting
84
84
@@ -4086,6 +4086,7 @@ def rename(
4086
4086
Union [Hashable , Mapping [Hashable , Hashable ], Callable [[Hashable ], Hashable ]]
4087
4087
] = None ,
4088
4088
* ,
4089
+ axis : Optional [Axis ] = None ,
4089
4090
copy : bool = True ,
4090
4091
inplace : bool = False ,
4091
4092
level : Optional [Level ] = None ,
@@ -4104,6 +4105,8 @@ def rename(
4104
4105
4105
4106
Parameters
4106
4107
----------
4108
+ axis : int or str
4109
+ Unused. Accepted for compatability with DataFrame method only.
4107
4110
index : scalar, hashable sequence, dict-like or function, optional
4108
4111
Functions or dict-like are transformations to apply to
4109
4112
the index.
@@ -4125,6 +4128,7 @@ def rename(
4125
4128
4126
4129
See Also
4127
4130
--------
4131
+ DataFrame.rename : Corresponding DataFrame method.
4128
4132
Series.rename_axis : Set the name of the axis.
4129
4133
4130
4134
Examples
@@ -4152,7 +4156,7 @@ def rename(
4152
4156
dtype: int64
4153
4157
"""
4154
4158
if callable (index ) or is_dict_like (index ):
4155
- return super ().rename (index = index , copy = copy , inplace = inplace , level = level , errors = errors )
4159
+ return super ().rename (index , copy = copy , inplace = inplace , level = level , errors = errors )
4156
4160
else :
4157
4161
return self ._set_name (index , inplace = inplace )
4158
4162
0 commit comments