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