polars.Series.item#

Series.item() Any[source]#

Return the series as a scalar.

Equivalent to s[0], with a check that the shape is (1,).

Examples

>>> s = pl.Series("a", [1])
>>> s.item()
1