polars.Series.arg_max#

Series.arg_max() int | None[source]#

Get the index of the maximal value.

Returns:
int

Examples

>>> s = pl.Series("a", [3, 2, 1])
>>> s.arg_max()
0