Course Name: Python For Trading!, Section No: 7, Unit No: 5, Unit type: Exercise
df1=df.drop_duplicates(inplace=False)
Why is the Syntax is pandas.DataFrame.drop_duplicates(subset, keep, inplace) the Solution is df1=df.drop_duplicates(inplace=False). Where did the "subset" go?
Hi Alvaro,
By default, the 'subset' parameter of drop_duplicates() is set to 'none'.
When the subset is 'none', the method considers all columns of the dataframe to identify the duplicates.
When the subset is set to a list of columns, the method considers only the columns in the subset to identify the duplicates.
In the exercise, we want to consider all columns to identify duplicates, hence we didn't pass the parameter 'subset' ( subset= none, by default)
Hope this clears your doubt. Please leave a message if you need further assistance.
Thanks