MultiIndex.
unique
Return unique values in the index.
Be aware the order of unique values might be different than pandas.Index.unique
See also
Series.unique
groupby.SeriesGroupBy.unique
Examples
>>> ps.DataFrame({'a': ['a', 'b', 'c']}, index=[1, 1, 3]).index.unique().sort_values() Int64Index([1, 3], dtype='int64')
>>> ps.DataFrame({'a': ['a', 'b', 'c']}, index=['d', 'e', 'e']).index.unique().sort_values() Index(['d', 'e'], dtype='object')
MultiIndex
>>> ps.MultiIndex.from_tuples([("A", "X"), ("A", "Y"), ("A", "X")]).unique() ... MultiIndex([('A', 'X'), ('A', 'Y')], )