Spec-Zone.ru › Polars

polars.Series.all

Series.all(
    *,
    ignore_nulls: bool = True,
) → bool | None

Return whether all values in the column are True.

Only works on columns of data type Boolean.

Parameters:
ignore_nulls
  • If set to True (default), null values are ignored. If there are no non-null values, the output is True.
  • If set to False, Kleene logic is used to deal with nulls: if the column contains any null values and no False 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

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.all.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API