W3cubDocs

/pandas 0.25

pandas.DataFrame.duplicated

DataFrame.duplicated(self, subset=None, keep='first') [source]

Return boolean Series denoting duplicate rows, optionally only considering certain columns.

Parameters:
subset : column label or sequence of labels, optional

Only consider certain columns for identifying duplicates, by default use all of the columns

keep : {‘first’, ‘last’, False}, default ‘first’
  • 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

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.DataFrame.duplicated.html