polars.Expr.arg_true
-
Return indices where expression evaluates
True.Warning
Modifies number of rows returned, so will fail in combination with other expressions. Use as only expression in
select/with_columns.See also
-
Series.arg_true -
Return indices where Series is True
-
polars.arg_where
Examples
>>> df = pl.DataFrame({"a": [1, 1, 2, 1]}) >>> df.select((pl.col("a") == 1).arg_true()) shape: (3, 1) ┌─────┐ │ a │ │ --- │ │ u32 │ ╞═════╡ │ 0 │ │ 1 │ │ 3 │ └─────┘ -
Expr.arg_true() → Expr
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.arg_true.html