Pandas Series: duplicated() function
Indicate duplicate Series values
The duplicated() function is used to 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.
Syntax:
Series.duplicated(self, keep='first')
Parameters:
Name | Description | Type/Default Value | Required / Optional |
---|---|---|---|
keep |
|
{‘first’, ‘last’, False}, Default Value: ‘first’ |
Required |
Returns: Series indicating whether each value has occurred in the preceding values.
Example:
Download the Pandas Series Notebooks from here.
Previous: Remove Pandas series with duplicate values
Next: Test Pandas objects contain the same elements
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework