df1 = {
'vouchers': [100, 200, 300, 400],
'units': [11, 12, 12, 13],
'some_other_data': ['a', 'b', 'c', 'd'],
}
df2 = {
'vouchers': [500, 200, 600, 300],
'units': [11, 12, 12, 13],
'some_other_data': ['b', 'd', 'c', 'a'],
}
Given the two dataframes like above, I want to do the following: if voucher from df1 can be found in df2, and their corresponding unit is the same, then delete the entire voucher row from df1.
So in this case the desired output would be:
df1 = {
'vouchers': [100, 300, 400],
'units': [11, 12, 13],
'some_other_data': ['a', 'c', 'd'],
}
What would be the best way to achieve this?