pyspark.pandas.Index.drop_duplicates¶
-
Index.
drop_duplicates
() → pyspark.pandas.indexes.base.Index[source]¶ Return Index with duplicate values removed.
- Returns
- deduplicatedIndex
See also
Series.drop_duplicates
Equivalent method on Series.
DataFrame.drop_duplicates
Equivalent method on DataFrame.
Examples
Generate an pandas.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')