Indicate duplicate Series values.
Duplicated values are indicated as True values in the resulting
Series. Either all duplicates, all except the first or all except the
last occurrence of duplicates can be indicated.
Method to handle dropping duplicates:
‘first’ : Mark duplicates as True except for the first
‘last’ : Mark duplicates as True except for the last
False : Mark all duplicates as True.
Series indicating whether each value has occurred in the
Equivalent method on pandas.Index.
Equivalent method on pandas.DataFrame.
Remove duplicate values from Series.
By default, for each set of duplicated values, the first occurrence is
set on False and all others on True:
>>> animals = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama'])
which is equivalent to
By using ‘last’, the last occurrence of each set of duplicated values
is set on False and all others on True:
By setting keep on False, all duplicates are True: