modin.pandas.Index.has_duplicates

property Index.has_duplicates: bool[source]

Check if the Index has duplicate values.

Returns:

True if the index has duplicate values, False otherwise.

Return type:

bool

See also

Index.is_unique

Inverse method that checks if it has unique values.

Examples

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