polars.Series.list.arg_max#

Series.list.arg_max() Series[source]#

Retrieve the index of the maximum value in every sublist.

Returns:
Series

Series of data type UInt32 or UInt64 (depending on compilation).

Examples

>>> s = pl.Series("a", [[1, 2], [2, 1]])
>>> s.list.arg_max()
shape: (2,)
Series: 'a' [u32]
[
    1
    0
]