Skip to content

Commit ea521ad

Browse files
author
Lucas Kushner
committed
Deprecating Series.argmin and Series.argmax (pandas-dev#16830)
1 parent 4c498f8 commit ea521ad

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/source/whatsnew/v0.21.0.txt

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ Other API Changes
116116
Deprecations
117117
~~~~~~~~~~~~
118118
- :func:`read_excel()` has deprecated ``sheetname`` in favor of ``sheet_name`` for consistency with ``.to_excel()`` (:issue:`10559`).
119+
- :method:`Series.argmax` has been deprecated in favor of :method:`Series.idxmax` (:issue:`16830`)
120+
- :method:`Series.argmin` has been deprecated in favor of :method:`Series.idxmin` (:issue:`16830`)
119121

120122

121123
.. _whatsnew_0210.prior_deprecations:

pandas/core/series.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
import pandas.core.common as com
7272
import pandas.core.nanops as nanops
7373
import pandas.io.formats.format as fmt
74-
from pandas.util._decorators import Appender, deprecate_kwarg, Substitution
74+
from pandas.util._decorators import Appender, deprecate, deprecate_kwarg, Substitution
7575
from pandas.util._validators import validate_bool_kwarg
7676

7777
from pandas._libs import index as libindex, tslib as libts, lib, iNaT
@@ -1293,8 +1293,8 @@ def idxmax(self, axis=None, skipna=True, *args, **kwargs):
12931293
return self.index[i]
12941294

12951295
# ndarray compat
1296-
argmin = idxmin
1297-
argmax = idxmax
1296+
argmin = deprecate('argmin', idxmin)
1297+
argmax = deprecate('argmax', idxmax)
12981298

12991299
def round(self, decimals=0, *args, **kwargs):
13001300
"""

0 commit comments

Comments
 (0)