polars.all#

polars.all(exprs: Series) bool[source]#
polars.all(exprs: IntoExpr | Iterable[IntoExpr] | None = None, *more_exprs: IntoExpr) Expr

Either return an expression representing all columns, or evaluate a bitwise AND operation.

If no arguments are passed, this is an alias for pl.col("*"). If a single string is passed, this is an alias for pl.col(name).any().

If a single Series is passed, this is an alias for Series.any(). This functionality is deprecated.

Otherwise, this function computes the bitwise AND horizontally across multiple columns. This functionality is deprecated, use pl.all_horizontal instead.

Parameters:
exprs

Column(s) to use in the aggregation. Accepts expression input. Strings are parsed as column names, other non-expression inputs are parsed as literals.

*more_exprs

Additional columns to use in the aggregation, specified as positional arguments.

See also

all_horizontal

Examples

Selecting all columns.

>>> df = pl.DataFrame(
...     {
...         "a": [True, False, True],
...         "b": [False, False, False],
...     }
... )
>>> df.select(pl.all().sum())
shape: (1, 2)
┌─────┬─────┐
│ a   ┆ b   │
│ --- ┆ --- │
│ u32 ┆ u32 │
╞═════╪═════╡
│ 2   ┆ 0   │
└─────┴─────┘

Evaluate bitwise AND for a column:

>>> df.select(pl.all("a"))
shape: (1, 1)
┌───────┐
│ a     │
│ ---   │
│ bool  │
╞═══════╡
│ false │
└───────┘