pyspark.pandas.Series.item

Series.item() → Union[int, float, bool, str, bytes, decimal.Decimal, datetime.date, datetime.datetime, None]

Return the first element of the underlying data as a Python scalar.

Returns
scalar

The first element of Series.

Raises
ValueError

If the data is not length-1.

Examples

>>> psser = ps.Series([10])
>>> psser.item()
10