Skip to content

Return indices where expression is true

Description

Return indices where expression is true

Usage

<Expr>$arg_true()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(a = c(1, 1, 2, 1))
df$select((pl$col("a") == 1)$arg_true())
#> shape: (3, 1)
#> ┌─────┐
#> │ a   │
#> │ --- │
#> │ u32 │
#> ╞═════╡
#> │ 0   │
#> │ 1   │
#> │ 3   │
#> └─────┘