- Series.item(index: int | None = None) Any #
Return the Series as a scalar, or return the element at the given index.
If no index is provided, this is equivalent to
s, with a check that the shape is (1,). With an index, this is equivalent to
>>> s1 = pl.Series("a", ) >>> s1.item() 1 >>> s2 = pl.Series("a", [9, 8, 7]) >>> s2.cum_sum().item(-1) 24