keep only one duplicate in pandas

Solutions on MaxInterview for keep only one duplicate in pandas by the best coders in the world

showing results for - "keep only one duplicate in pandas"
Clara
24 Nov 2019
1import pandas as pd
2df = pd.DataFrame({"A":["foo", "foo", "foo", "bar"], "B":[0,1,1,1], "C":["A","A","B","A"]})
3df.drop_duplicates(subset=['A', 'C'], keep=False)
4