Evaluate whether any boolean values in a list are true
Description
Evaluate whether any boolean values in a list are true
Usage
<Expr>$list$any()
Value
Expr
Examples
library("polars")
df = pl$DataFrame(
list(a = list(c(TRUE, TRUE), c(FALSE, TRUE), c(FALSE, FALSE), NA, c()))
)
df$with_columns(any = pl$col("a")$list$any())
#> shape: (5, 2)
#> ┌────────────────┬───────┐
#> │ a ┆ any │
#> │ --- ┆ --- │
#> │ list[bool] ┆ bool │
#> ╞════════════════╪═══════╡
#> │ [true, true] ┆ true │
#> │ [false, true] ┆ true │
#> │ [false, false] ┆ false │
#> │ [null] ┆ false │
#> │ [] ┆ false │
#> └────────────────┴───────┘