From de1fe739798c771e67da97ab922cbb697a878f81 Mon Sep 17 00:00:00 2001 From: Farhan Reynaldo Hutabarat Date: Sat, 15 Feb 2020 16:15:59 +0700 Subject: [PATCH 1/2] add description to parameter skipna --- pandas/core/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/base.py b/pandas/core/base.py index 56d3596f71813..18c422f7fa1dc 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -934,6 +934,7 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs): axis : {None} Dummy argument for consistency with Series. skipna : bool, default True + Exclude NA/null values when showing the result. Returns ------- From abf7c24c7e6f42b650845a335d2eb553a32fad63 Mon Sep 17 00:00:00 2001 From: Farhan Reynaldo Hutabarat Date: Sat, 15 Feb 2020 17:40:19 +0700 Subject: [PATCH 2/2] DOC: Fix errors in pandas.Series.argmax --- pandas/core/base.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 18c422f7fa1dc..69a4ecd03a2a6 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -929,12 +929,17 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs): """ Return an ndarray of the maximum argument indexer. + If multiple values equal the maximum, the first row label with that + value is returned. + Parameters ---------- axis : {None} Dummy argument for consistency with Series. skipna : bool, default True Exclude NA/null values when showing the result. + *args, **kwargs + Additional arguments and keywords for compatibility with NumPy. Returns ------- @@ -943,7 +948,22 @@ def argmax(self, axis=None, skipna=True, *args, **kwargs): See Also -------- - numpy.ndarray.argmax + numpy.ndarray.argmax : Returns the indices of the maximum values along an axis. + + Examples + -------- + >>> s = pd.Series(data=[1, None, 5, 4, 5], + ... index=['A', 'B', 'C', 'D', 'E']) + >>> s + A 1.0 + B NaN + C 5.0 + D 4.0 + E 5.0 + dtype: float64 + + >>> s.argmax() + 2 """ nv.validate_minmax_axis(axis) nv.validate_argmax_with_skipna(skipna, args, kwargs)