I have a pandas
data frame with a column uniqueid
. I would like to remove all duplicates from the data frame based on this column, such that all remaining observations are unique.
I have a pandas
data frame with a column uniqueid
. I would like to remove all duplicates from the data frame based on this column, such that all remaining observations are unique.
There is also the drop_duplicates()
method for any data frame (docs here). You can pass specific columns to drop from as an argument.
df.drop_duplicates(subset='uniqueid', inplace=True)