Having a dataframe which contains duplicate values in two columns (A and B):
A B
1 2
2 3
4 5
7 6
5 8
I want to remove duplicates so that only unique values remain:
A B
1 2
4 5
7 6
This command does not provide what I want:
df.drop_duplicates(subset=['A','B'], keep='first')
Any idea how to do this?