databricks.koalas.Index.item

Index.item() → Union[int, float, str, bytes, decimal.Decimal, datetime.date, None, Tuple[Union[int, float, str, bytes, decimal.Decimal, datetime.date, None], …]][source]

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

Returns
scalar

The first element of Index.

Raises
ValueError

If the data is not length-1.

Examples

>>> kidx = ks.Index([10])
>>> kidx.item()
10