Drop all duplicate rows across multiple columns in Python Pandas
This is much easier in pandas now with drop_duplicates and the keep parameter. import pandas as pd df = pd.DataFrame({“A”:[“foo”, “foo”, “foo”, “bar”], “B”:[0,1,1,1], “C”:[“A”,”A”,”B”,”A”]}) df.drop_duplicates(subset=[‘A’, ‘C’], keep=False)