pyspark.pandas.MultiIndex.item#

MultiIndex.item()[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

>>> psmidx = ps.MultiIndex.from_tuples([('a', 'x')])
>>> psmidx.item()
('a', 'x')