The pandas drop_duplicates function is great for \"uniquifying\" a dataframe. However, one of the keyword arguments to pass is take_last=True
pandas
drop_duplicates
take_last=True
Try these various things
df = pd.DataFrame({"A":["foo", "foo", "foo", "bar","foo"], "B":[0,1,1,1,1], "C":["A","A","B","A","A"]}) >>>df.drop_duplicates( "A" , keep='first')
or
>>>df.drop_duplicates( keep='first')
>>>df.drop_duplicates( keep='last')