Python | Pandas Series.duplicated() Last Updated : 13 Feb, 2019 Comments Improve Suggest changes Like Article Like Report Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.duplicated() function indicate duplicate Series values. The 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(keep='first') Parameter : keep : {‘first’, ‘last’, False}, default ‘first’ Returns : pandas.core.series.Series Example #1: Use Series.duplicated() function to find the duplicate values in the given series object. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series([80, 25, 3, 25, 24, 6]) # Create the Index index_ = ['Coca Cola', 'Sprite', 'Coke', 'Fanta', 'Dew', 'ThumbsUp'] # set the index sr.index = index_ # Print the series print(sr) Output : Now we will use Series.duplicated() function to find the duplicate values in the underlying data of the given series object. Python3 1== # detect duplicates result = sr.duplicated() # Print the result print(result) Output : As we can see in the output, the Series.duplicated() function has successfully detected the duplicated values in the given series object. False indicates that the corresponding value is unique whereas, True indicates that the corresponding value was a duplicated value in the given series object. Example #2 : Use Series.duplicated() function to find the duplicate values in the given series object. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series([11, 11, 8, 18, 65, 18, 32, 10, 5, 32, 32]) # Create the Index index_ = pd.date_range('2010-10-09', periods = 11, freq ='M') # set the index sr.index = index_ # Print the series print(sr) Output : Now we will use Series.duplicated() function to find the duplicate values in the underlying data of the given series object. Python3 1== # detect duplicates result = sr.duplicated() # Print the result print(result) Output : As we can see in the output, the Series.duplicated() function has successfully detected the duplicated values in the given series object. False indicates that the corresponding value is unique whereas, True indicates that the corresponding value was a duplicated value in the given series object. Comment More infoAdvertise with us Next Article Python | Pandas Series.duplicated() S Shubham__Ranjan Follow Improve Article Tags : Python Pandas Python-pandas Python pandas-series-methods AI-ML-DS With Python +1 More Practice Tags : python Similar Reads Python | Pandas Series.drop_duplicates() Pandas Series.drop_duplicates() function returns a series object with duplicate values removed from the given series object. Syntax: Series.drop_duplicates(keep='first', inplace=False) Parameter : keep : {âfirstâ, âlastâ, False}, default âfirstâ inplace : If True, performs operation inplace and retu 2 min read Python | Pandas Series.iat Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Python | Pandas Series.item() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.item() function return the fi 2 min read Python | Pandas Series.last() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.last() function is a convenie 2 min read Python | Pandas Series.data Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Python | Pandas Series.to_dict() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.to_dict() function is used to 3 min read Python | Pandas Series.items() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.items() function iterates ove 2 min read Python | Pandas Series.append() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.append() function is used to 4 min read Python | Pandas Series.dropna() Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.dropna() function return a ne 2 min read Python | Pandas Series.iloc Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas series is a One-dimensional ndarray with axis labels. The labels need not be un 2 min read Like