Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Fix errors in pandas.Series.argmax #32010

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +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
-------
Expand All @@ -942,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)
Expand Down