Skip to content

Commit

Permalink
DEPR: removed long deprecated input param 'axis' in .replace() (#20789)
Browse files Browse the repository at this point in the history
  • Loading branch information
math-and-data authored and jreback committed May 3, 2018
1 parent b02c69a commit 2ab3727
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.23.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,7 @@ Removal of prior version deprecations/changes
``ambiguous='infer'``, and ``infer_dst=False`` to ``ambiguous='raise'`` (:issue:`7963`).
- When ``.resample()`` was changed from an eager to a lazy operation, like ``.groupby()`` in v0.18.0, we put in place compatibility (with a ``FutureWarning``),
so operations would continue to work. This is now fully removed, so a ``Resampler`` will no longer forward compat operations (:issue:`20554`)
- Remove long deprecated ``axis=None`` parameter from ``.replace()`` (:issue:`20271`)

.. _whatsnew_0230.performance:

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3790,11 +3790,11 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,

@Appender(_shared_docs['replace'] % _shared_doc_kwargs)
def replace(self, to_replace=None, value=None, inplace=False, limit=None,
regex=False, method='pad', axis=None):
regex=False, method='pad'):
return super(DataFrame, self).replace(to_replace=to_replace,
value=value, inplace=inplace,
limit=limit, regex=regex,
method=method, axis=axis)
method=method)

@Appender(_shared_docs['shift'] % _shared_doc_kwargs)
def shift(self, periods=1, freq=None, axis=0):
Expand Down
9 changes: 1 addition & 8 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5543,9 +5543,6 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
.. versionchanged:: 0.23.0
Added to DataFrame.
axis : None
.. deprecated:: 0.13.0
Has no effect and will be removed.
See Also
--------
Expand Down Expand Up @@ -5753,15 +5750,11 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None):

@Appender(_shared_docs['replace'] % _shared_doc_kwargs)
def replace(self, to_replace=None, value=None, inplace=False, limit=None,
regex=False, method='pad', axis=None):
regex=False, method='pad'):
inplace = validate_bool_kwarg(inplace, 'inplace')
if not is_bool(regex) and to_replace is not None:
raise AssertionError("'to_replace' must be 'None' if 'regex' is "
"not a bool")
if axis is not None:
warnings.warn('the "axis" argument is deprecated '
'and will be removed in'
'v0.13; this argument has no effect')

self._consolidate_inplace()

Expand Down
5 changes: 2 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3423,11 +3423,10 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,

@Appender(generic._shared_docs['replace'] % _shared_doc_kwargs)
def replace(self, to_replace=None, value=None, inplace=False, limit=None,
regex=False, method='pad', axis=None):
regex=False, method='pad'):
return super(Series, self).replace(to_replace=to_replace, value=value,
inplace=inplace, limit=limit,
regex=regex, method=method,
axis=axis)
regex=regex, method=method)

@Appender(generic._shared_docs['shift'] % _shared_doc_kwargs)
def shift(self, periods=1, freq=None, axis=0):
Expand Down

0 comments on commit 2ab3727

Please sign in to comment.