Evaluate whether any boolean value is true for every sub-array
Description
Evaluate whether any boolean value is true for every sub-array
Usage
<Expr>$arr$any()
Value
A polars expression
Examples
library("polars")
df <- pl$DataFrame(
values = list(c(TRUE, TRUE), c(FALSE, TRUE), c(FALSE, FALSE), c(NA, NA)),
)$cast(pl$Array(pl$Boolean, 2))
df$with_columns(any = pl$col("values")$arr$any())
#> shape: (4, 2)
#> ┌────────────────┬───────┐
#> │ values ┆ any │
#> │ --- ┆ --- │
#> │ array[bool, 2] ┆ bool │
#> ╞════════════════╪═══════╡
#> │ [true, true] ┆ true │
#> │ [false, true] ┆ true │
#> │ [false, false] ┆ false │
#> │ [null, null] ┆ false │
#> └────────────────┴───────┘