- API reference
- Index objects
- pandas.Index...
pandas.Index.is_unique#
- Index.is_unique[source]#
Return if the index has unique values.
- Returns:
- bool
See also
Index.has_duplicates
Inverse method that checks if it has duplicate values.
Examples
>>>idx=pd.Index([1,5,7,7])>>>idx.is_uniqueFalse
>>>idx=pd.Index([1,5,7])>>>idx.is_uniqueTrue
>>>idx=pd.Index(["Watermelon","Orange","Apple",..."Watermelon"]).astype("category")>>>idx.is_uniqueFalse
>>>idx=pd.Index(["Orange","Apple",..."Watermelon"]).astype("category")>>>idx.is_uniqueTrue
On this page