pyspark.pandas.Index.is_unique

property Index.is_unique

Return if the index has unique values.

Examples

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