polars.Series.all#

Series.all(*, ignore_nulls: Literal[True] = True) bool[source]#
Series.all(*, ignore_nulls: bool) bool | None

Return whether all values in the column are True.

Only works on columns of data type Boolean.

Parameters:
ignore_nulls

Ignore null values (default).

If set to False, Kleene logic is used to deal with nulls: if the column contains any null values and no True values, the output is None.

Returns:
bool or None

Examples

>>> pl.Series([True, True]).all()
True
>>> pl.Series([False, True]).all()
False
>>> pl.Series([None, True]).all()
True

Enable Kleene logic by setting ignore_nulls=False.

>>> pl.Series([None, True]).all(ignore_nulls=False)  # Returns None