Index.
where
Return an Index of same shape as self and whose corresponding entries are from self where cond is True and otherwise are from other.
pandas.Index.value_counts
pandas.Index.has_duplicates