Spec-Zone.ru › Polars

polars.Series.min_by

Series.min_by(
    by: IntoExpr,
) → Expr

Get the minimum value in this Series, ordered by an expression.

If the by expression has multiple values equal to the minimum it is not defined which value will be chosen.

Warning

This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.

Parameters:
by

Column used to determine the smallest element. Accepts expression input. Strings are parsed as column names.

Examples

>>> s = pl.Series("a", [-2.0, float("nan"), 1.0])
>>> s.min_by(pl.col.a.abs())
1.0

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

Spec-Zone.ru

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