polars.Series.is_empty#

Series.is_empty(*, ignore_nulls: bool = False) bool[source]#

Check if the Series is empty.

Parameters:
ignore_nulls

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

Warning

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

Examples

>>> s = pl.Series("a", [], dtype=pl.Float32)
>>> s.is_empty()
True
>>> s = pl.Series("a", [None], dtype=pl.Float32)
>>> s.is_empty()
False
>>> s.is_empty(ignore_nulls=True)
True