Python | Pandas Series.drop_duplicates() Last Updated : 13 Feb, 2019 Comments Improve Suggest changes Like Article Like Report 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 returns None. Returns : deduplicated : Series Example #1: Use Series.drop_duplicates() function to drop the duplicate values from 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.drop_duplicates() function to drop the duplicate values in the underlying data of the given series object. Python3 1== # drop duplicates result = sr.drop_duplicates() # Print the result print(result) Output : As we can see in the output, the Series.drop_duplicates() function has successfully dropped the duplicate entries from the given series object. Example #2 : Use Series.drop_duplicates() function to drop the duplicate values from 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.drop_duplicates() function to drop the duplicate values in the underlying data of the given series object. Python3 1== # drop duplicates result = sr.drop_duplicates() # Print the result print(result) Output : As we can see in the output, the Series.drop_duplicates() function has successfully dropped the duplicate entries from the given series object. Comment More infoAdvertise with us Next Article Python | Pandas Series.drop_duplicates() 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.duplicated() 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 2 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 Index.drop_duplicates() Pandas Index.drop_duplicates() function return Index with duplicate values removed in Python. Syntax of Pandas Index.drop_duplicates() Syntax: Index.drop_duplicates(labels, errors='raise')Â Parameters : keep : {âfirstâ, âlastâ, False} âfirstâ : Drop duplicates except for the first occurrence.(defaul 2 min read Python | Pandas TimedeltaIndex.drop_duplicates 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 TimedeltaIndex.drop_duplicates() function return Index with duplicate values re 2 min read Python | Pandas Series.drop() 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.drop() function return Series 3 min read Like