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.
Parameters:
keep : {‘first’, ‘last’, False}, default ‘first’
Method to handle dropping duplicates:
‘first’ : Mark duplicates as True except for the first
occurrence.
‘last’ : Mark duplicates as True except for the last
occurrence.
False : Mark all duplicates as True.
Returns:
Series[bool]
Series indicating whether each value has occurred in the
preceding values.
Examples
By default, for each set of duplicated values, the first occurrence is
set on False and all others on True: