Skip to content

Commit 2ab3727

Browse files
math-and-datajreback
authored andcommitted
DEPR: removed long deprecated input param 'axis' in .replace() (#20789)
1 parent b02c69a commit 2ab3727

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

doc/source/whatsnew/v0.23.0.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ Removal of prior version deprecations/changes
10371037
``ambiguous='infer'``, and ``infer_dst=False`` to ``ambiguous='raise'`` (:issue:`7963`).
10381038
- 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``),
10391039
so operations would continue to work. This is now fully removed, so a ``Resampler`` will no longer forward compat operations (:issue:`20554`)
1040+
- Remove long deprecated ``axis=None`` parameter from ``.replace()`` (:issue:`20271`)
10401041

10411042
.. _whatsnew_0230.performance:
10421043

pandas/core/frame.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3790,11 +3790,11 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
37903790

37913791
@Appender(_shared_docs['replace'] % _shared_doc_kwargs)
37923792
def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3793-
regex=False, method='pad', axis=None):
3793+
regex=False, method='pad'):
37943794
return super(DataFrame, self).replace(to_replace=to_replace,
37953795
value=value, inplace=inplace,
37963796
limit=limit, regex=regex,
3797-
method=method, axis=axis)
3797+
method=method)
37983798

37993799
@Appender(_shared_docs['shift'] % _shared_doc_kwargs)
38003800
def shift(self, periods=1, freq=None, axis=0):

pandas/core/generic.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5543,9 +5543,6 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
55435543
55445544
.. versionchanged:: 0.23.0
55455545
Added to DataFrame.
5546-
axis : None
5547-
.. deprecated:: 0.13.0
5548-
Has no effect and will be removed.
55495546
55505547
See Also
55515548
--------
@@ -5753,15 +5750,11 @@ def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
57535750

57545751
@Appender(_shared_docs['replace'] % _shared_doc_kwargs)
57555752
def replace(self, to_replace=None, value=None, inplace=False, limit=None,
5756-
regex=False, method='pad', axis=None):
5753+
regex=False, method='pad'):
57575754
inplace = validate_bool_kwarg(inplace, 'inplace')
57585755
if not is_bool(regex) and to_replace is not None:
57595756
raise AssertionError("'to_replace' must be 'None' if 'regex' is "
57605757
"not a bool")
5761-
if axis is not None:
5762-
warnings.warn('the "axis" argument is deprecated '
5763-
'and will be removed in'
5764-
'v0.13; this argument has no effect')
57655758

57665759
self._consolidate_inplace()
57675760

pandas/core/series.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3423,11 +3423,10 @@ def fillna(self, value=None, method=None, axis=None, inplace=False,
34233423

34243424
@Appender(generic._shared_docs['replace'] % _shared_doc_kwargs)
34253425
def replace(self, to_replace=None, value=None, inplace=False, limit=None,
3426-
regex=False, method='pad', axis=None):
3426+
regex=False, method='pad'):
34273427
return super(Series, self).replace(to_replace=to_replace, value=value,
34283428
inplace=inplace, limit=limit,
3429-
regex=regex, method=method,
3430-
axis=axis)
3429+
regex=regex, method=method)
34313430

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

0 commit comments

Comments
 (0)