Spec-Zone.ru › Polars

polars.arg_where

polars.arg_where(
    condition: Expr | Series,
    *,
    eager: bool = False,
) → Expr | Series

Return indices where condition evaluates True.

Parameters:
condition

Boolean expression to evaluate

eager

Evaluate immediately and return a Series; this requires that the given condition is itself a Series. If set to False (default), return an expression instead.

See also

Series.arg_true

Return indices where Series is True

Examples

>>> df = pl.DataFrame({"a": [1, 2, 3, 4, 5]})
>>> df.select(
...     [
...         pl.arg_where(pl.col("a") % 2 == 0),
...     ]
... ).to_series()
shape: (2,)
Series: 'a' [u32]
[
    1
    3
]

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

Spec-Zone.ru

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