Spec-Zone.ru › Polars

polars.Expr.arg_max

Expr.arg_max() → Expr

Get an index of a maximal value.

When multiple values are equal to the maximum, this function may arbitrarily return the index of any of the maximum values. In this case, the returned index is not guaranteed to be the same across multiple runs.

engine:In MemoryStreaming

Examples

>>> df = pl.DataFrame(
...     {
...         "a": [20, 10, 30],
...     }
... )
>>> df.select(pl.col("a").arg_max())
shape: (1, 1)
┌─────┐
│ a   │
│ --- │
│ u32 │
╞═════╡
│ 2   │
└─────┘

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.arg_max.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API