pyspark.pandas.MultiIndex.has_duplicates#

property MultiIndex.has_duplicates#

If index has duplicates, return True, otherwise False.

Examples

>>> idx = ps.Index([1, 5, 7, 7])
>>> idx.has_duplicates
True
>>> idx = ps.Index([1, 5, 7])
>>> idx.has_duplicates
False
>>> idx = ps.Index(["Watermelon", "Orange", "Apple",
...                 "Watermelon"])
>>> idx.has_duplicates
True
>>> idx = ps.Index(["Orange", "Apple",
...                 "Watermelon"])
>>> idx.has_duplicates
False