Skip to content

Commit

Permalink
Deprecating Series.argmin and Series.argmax (#16830)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Kushner committed Jul 15, 2017
1 parent 4c498f8 commit 2784c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.21.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 2784c3f

Please sign in to comment.