polars.Expr.is_empty
-
Return whether the column is empty.
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 │ └───────┴──────┴──────┘
Expr.is_empty(
*,
ignore_nulls: bool = False,
) → Expr
© 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