pandas.Series.duplicated

pandas 3.1.1 · Series and accessors · method

Mark repeated values or rows with a boolean mask. Use keep=False to mark every member of a duplicate set.

Call syntax

Series.duplicated(keep='first')

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
keep Optional
Positional or keyword
Default 'first'
{'first', 'last', False}

Choose which occurrence to retain when values are duplicated or tied.

Returns

Series[bool]