Skip to content

Commit

Permalink
fixup! API: Accept 'axis' keyword argument for reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Oct 10, 2017
1 parent aa06810 commit de8db68
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 5 additions & 5 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2967,11 +2967,11 @@ def rename(self, mapper=None, index=None, columns=None, axis=None,
Parameters
----------
mapper : dict-like or function, optional
Applied to the axis specified by ``axis``
index, columns : scalar, list-like, dict-like or function, optional
mapper, index, columns : dict-like or function, optional
dict-like or functions transformations to apply to
that axis' values
that axis' values. Use either ``mapper`` and ``axis`` to
specify the axis to target with ``mapper``, or ``index`` and
``columns``.
axis : int or str, optional
Axis to target with ``mapper``. Can be either the axis name
('index', 'columns') or number (0, 1). The default is 'index'.
Expand All @@ -2990,7 +2990,7 @@ def rename(self, mapper=None, index=None, columns=None, axis=None,
See Also
--------
pandas.NDFrame.rename_axis
pandas.DataFrame.rename_axis
Examples
--------
Expand Down
9 changes: 5 additions & 4 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ def align(self, other, join='outer', axis=None, level=None, copy=True,
broadcast_axis=broadcast_axis)

def rename(self, index=None, **kwargs):
"""Alter Series row labels or name
"""Alter Series index labels or name
Function / dict values must be unique (1-to-1). Labels not contained in
a dict / Series will be left as-is. Extra labels listed don't throw an
Expand All @@ -2538,10 +2538,11 @@ def rename(self, index=None, **kwargs):
Parameters
----------
index : scalar, list-like, dict-like or function, optional
index : scalar, hashable sequence, dict-like or function, optional
dict-like or functions are transformations to apply to
the index.
Scalar or list-like will alter the ``Series.name`` attribute.
Scalar or hashable sequence-like will alter the ``Series.name``
attribute.
copy : boolean, default True
Also copy underlying data
inplace : boolean, default False
Expand All @@ -2557,7 +2558,7 @@ def rename(self, index=None, **kwargs):
See Also
--------
pandas.DataFrame.rename_axis
pandas.Series.rename_axis
Examples
--------
Expand Down

0 comments on commit de8db68

Please sign in to comment.