Spec-Zone.ru › Polars

polars.Expr.is_empty

Expr.is_empty(
    *,
    ignore_nulls: bool = False,
) → Expr

Return whether the column is empty.

engine:In MemoryStreaming

Warning

This functionality is considered unstable. It may be changed at any point without it being considered a breaking change.

Parameters:
ignore_nulls

If true a column containing only nulls will also be considered empty. The default is false.

Returns:
Expr

Expression of data type Boolean.

Examples

>>> df = pl.DataFrame({"x": [None, None]})
>>> df.select(
...     a=pl.col.x.is_empty(),
...     b=pl.col.x.drop_nulls().is_empty(),
...     c=pl.col.x.is_empty(ignore_nulls=True),
... )
shape: (1, 3)
┌───────┬──────┬──────┐
│ a     ┆ b    ┆ c    │
│ ---   ┆ ---  ┆ ---  │
│ bool  ┆ bool ┆ bool │
╞═══════╪══════╪══════╡
│ false ┆ true ┆ true │
└───────┴──────┴──────┘

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

Spec-Zone.ru

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