databricks.koalas.MultiIndex.item

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

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

Returns
tuple

The first element of MultiIndex.

Raises
ValueError

If the data is not length-1.

Examples

>>> kmidx = ks.MultiIndex.from_tuples([('a', 'x')])
>>> kmidx.item()
('a', 'x')