Skip to content

Commit de8db68

Browse files
committed
fixup! API: Accept 'axis' keyword argument for reindex
1 parent aa06810 commit de8db68

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pandas/core/frame.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2967,11 +2967,11 @@ def rename(self, mapper=None, index=None, columns=None, axis=None,
29672967
29682968
Parameters
29692969
----------
2970-
mapper : dict-like or function, optional
2971-
Applied to the axis specified by ``axis``
2972-
index, columns : scalar, list-like, dict-like or function, optional
2970+
mapper, index, columns : dict-like or function, optional
29732971
dict-like or functions transformations to apply to
2974-
that axis' values
2972+
that axis' values. Use either ``mapper`` and ``axis`` to
2973+
specify the axis to target with ``mapper``, or ``index`` and
2974+
``columns``.
29752975
axis : int or str, optional
29762976
Axis to target with ``mapper``. Can be either the axis name
29772977
('index', 'columns') or number (0, 1). The default is 'index'.
@@ -2990,7 +2990,7 @@ def rename(self, mapper=None, index=None, columns=None, axis=None,
29902990
29912991
See Also
29922992
--------
2993-
pandas.NDFrame.rename_axis
2993+
pandas.DataFrame.rename_axis
29942994
29952995
Examples
29962996
--------

pandas/core/series.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ def align(self, other, join='outer', axis=None, level=None, copy=True,
25262526
broadcast_axis=broadcast_axis)
25272527

25282528
def rename(self, index=None, **kwargs):
2529-
"""Alter Series row labels or name
2529+
"""Alter Series index labels or name
25302530
25312531
Function / dict values must be unique (1-to-1). Labels not contained in
25322532
a dict / Series will be left as-is. Extra labels listed don't throw an
@@ -2538,10 +2538,11 @@ def rename(self, index=None, **kwargs):
25382538
25392539
Parameters
25402540
----------
2541-
index : scalar, list-like, dict-like or function, optional
2541+
index : scalar, hashable sequence, dict-like or function, optional
25422542
dict-like or functions are transformations to apply to
25432543
the index.
2544-
Scalar or list-like will alter the ``Series.name`` attribute.
2544+
Scalar or hashable sequence-like will alter the ``Series.name``
2545+
attribute.
25452546
copy : boolean, default True
25462547
Also copy underlying data
25472548
inplace : boolean, default False
@@ -2557,7 +2558,7 @@ def rename(self, index=None, **kwargs):
25572558
25582559
See Also
25592560
--------
2560-
pandas.DataFrame.rename_axis
2561+
pandas.Series.rename_axis
25612562
25622563
Examples
25632564
--------

0 commit comments

Comments
 (0)