polars.any#
- polars.any(*names: str, ignore_nulls: bool = True) Expr | bool | None[source]#
Evaluate a bitwise OR operation.
Syntactic sugar for
col(names).any().- Parameters:
- *names
Name(s) of the columns to use in the aggregation.
- ignore_nulls
If set to
True(default), null values are ignored. If there are no non-null values, the output isFalse.If set to
False, Kleene logic is used to deal with nulls: if the column contains any null values and noTruevalues, the output is null.
See also
Examples
>>> df = pl.DataFrame( ... { ... "a": [True, False, True], ... "b": [False, False, False], ... } ... ) >>> df.select(pl.any("a")) shape: (1, 1) ┌──────┐ │ a │ │ --- │ │ bool │ ╞══════╡ │ true │ └──────┘