Index.
drop_duplicates
Return Index with duplicate values removed.
False
Method to handle dropping duplicates: - ‘first’ : Drop duplicates except for the first occurrence. - ‘last’ : Drop duplicates except for the last occurrence. - False : Drop all duplicates.
See also
Series.drop_duplicates
Equivalent method on Series.
DataFrame.drop_duplicates
Equivalent method on DataFrame.
Examples
Generate an Index with duplicate values.
>>> idx = ps.Index(['lama', 'cow', 'lama', 'beetle', 'lama', 'hippo'])
>>> idx.drop_duplicates().sort_values() Index(['beetle', 'cow', 'hippo', 'lama'], dtype='object')