@@ -3911,7 +3911,8 @@ def drop(self, labels=None, axis=0, index=None, columns=None,
3911
3911
3912
3912
@rewrite_axis_style_signature ('mapper' , [('copy' , True ),
3913
3913
('inplace' , False ),
3914
- ('level' , None )])
3914
+ ('level' , None ),
3915
+ ('errors' , 'ignore' )])
3915
3916
def rename (self , * args , ** kwargs ):
3916
3917
"""
3917
3918
Alter axes labels.
@@ -3924,37 +3925,46 @@ def rename(self, *args, **kwargs):
3924
3925
3925
3926
Parameters
3926
3927
----------
3927
- mapper, index, columns : dict-like or function, optional
3928
- dict -like or functions transformations to apply to
3928
+ mapper : dict-like or function
3929
+ Dict -like or functions transformations to apply to
3929
3930
that axis' values. Use either ``mapper`` and ``axis`` to
3930
3931
specify the axis to target with ``mapper``, or ``index`` and
3931
3932
``columns``.
3932
- axis : int or str, optional
3933
+ index : dict-like or function
3934
+ Alternative to specifying axis (``mapper, axis=0``
3935
+ is equivalent to ``index=labels``).
3936
+ columns : dict-like or function
3937
+ Alternative to specifying axis (``mapper, axis=1``
3938
+ is equivalent to ``columns=mapper``).
3939
+ axis : int or str
3933
3940
Axis to target with ``mapper``. Can be either the axis name
3934
3941
('index', 'columns') or number (0, 1). The default is 'index'.
3935
- copy : boolean , default True
3936
- Also copy underlying data
3937
- inplace : boolean , default False
3942
+ copy : bool , default True
3943
+ Also copy underlying data.
3944
+ inplace : bool , default False
3938
3945
Whether to return a new DataFrame. If True then value of copy is
3939
3946
ignored.
3940
3947
level : int or level name, default None
3941
3948
In case of a MultiIndex, only rename labels in the specified
3942
3949
level.
3943
3950
errors : {'ignore', 'raise'}, default 'ignore'
3944
3951
If 'ignore', suppress error and existing labels are renamed.
3952
+
3945
3953
Returns
3946
3954
-------
3947
3955
DataFrame
3948
-
3949
- See Also
3950
- --------
3951
- DataFrame.rename_axis
3956
+ DataFrame with the renamed axis labels.
3952
3957
3953
3958
Raises
3954
3959
------
3955
3960
KeyError
3956
3961
If any of the labels is not found in the selected axis.
3957
3962
3963
+ See Also
3964
+ --------
3965
+ DataFrame.rename_axis: Set the name of the axis for the index or
3966
+ columns.
3967
+
3958
3968
Examples
3959
3969
--------
3960
3970
0 commit comments