polars.all#

polars.all(name: str | Sequence[Expr] | Expr | None = None) Expr[source]#

Do one of two things.

  • function can do a columnwise or elementwise AND operation

  • a wildcard column selection

Parameters:
name

If given this function will apply a bitwise & on the columns.

Examples

Sum all columns

>>> df = pl.DataFrame(
...     {"a": [1, 2, 3], "b": ["hello", "foo", "bar"], "c": [1, 1, 1]}
... )
>>> df.select(pl.all().sum())
shape: (1, 3)
┌─────┬──────┬─────┐
│ a   ┆ b    ┆ c   │
│ --- ┆ ---  ┆ --- │
│ i64 ┆ str  ┆ i64 │
╞═════╪══════╪═════╡
│ 6   ┆ null ┆ 3   │
└─────┴──────┴─────┘