diff --git a/doc/source/whatsnew/v0.21.0.txt b/doc/source/whatsnew/v0.21.0.txt index 6ddf6029b99bba..993c35dce7bacd 100644 --- a/doc/source/whatsnew/v0.21.0.txt +++ b/doc/source/whatsnew/v0.21.0.txt @@ -116,6 +116,8 @@ Other API Changes Deprecations ~~~~~~~~~~~~ - :func:`read_excel()` has deprecated ``sheetname`` in favor of ``sheet_name`` for consistency with ``.to_excel()`` (:issue:`10559`). +- :method:`Series.argmax` has been deprecated in favor of :method:`Series.idxmax` (:issue:`16830`) +- :method:`Series.argmin` has been deprecated in favor of :method:`Series.idxmin` (:issue:`16830`) .. _whatsnew_0210.prior_deprecations: diff --git a/pandas/core/series.py b/pandas/core/series.py index e1f668dd3afdae..5294031be0ff8a 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -71,7 +71,8 @@ import pandas.core.common as com import pandas.core.nanops as nanops import pandas.io.formats.format as fmt -from pandas.util._decorators import Appender, deprecate_kwarg, Substitution +from pandas.util._decorators import ( + Appender, deprecate, deprecate_kwarg, Substitution) from pandas.util._validators import validate_bool_kwarg from pandas._libs import index as libindex, tslib as libts, lib, iNaT @@ -1293,8 +1294,8 @@ def idxmax(self, axis=None, skipna=True, *args, **kwargs): return self.index[i] # ndarray compat - argmin = idxmin - argmax = idxmax + argmin = deprecate('argmin', idxmin) + argmax = deprecate('argmax', idxmax) def round(self, decimals=0, *args, **kwargs): """