A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/user_guide/../reference/api/pandas.Index.argmax.html below:

pandas.Index.argmax — pandas 3.0.0.dev0+2231.g4f2aa4d2be documentation

pandas.Index.argmax#
Index.argmax(axis=None, skipna=True, *args, **kwargs)[source]#

Return int position of the largest value in the Series.

If the maximum is achieved in multiple locations, the first row position is returned.

Parameters:
axis{None}

Unused. Parameter needed for compatibility with DataFrame.

skipnabool, default True

Exclude NA/null values. If the entire Series is NA, or if skipna=False and there is an NA value, this method will raise a ValueError.

*args, **kwargs

Additional arguments and keywords for compatibility with NumPy.

Returns:
int

Row position of the maximum value.

Examples

Consider dataset containing cereal calories

>>> s = pd.Series(
...     [100.0, 110.0, 120.0, 110.0],
...     index=[
...         "Corn Flakes",
...         "Almond Delight",
...         "Cinnamon Toast Crunch",
...         "Cocoa Puff",
...     ],
... )
>>> s
Corn Flakes              100.0
Almond Delight           110.0
Cinnamon Toast Crunch    120.0
Cocoa Puff               110.0
dtype: float64
>>> s.argmax()
np.int64(2)
>>> s.argmin()
np.int64(0)

The maximum cereal calories is the third element and the minimum cereal calories is the first element, since series is zero-indexed.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4