Problem Explanation
I have a dataframe with two columns 'A' and 'B'. I also have a list of tuples where the first element of the tuple is an element in the column 'A', and the second is in the column 'B'. I would like to remove all rows of the dataframe coinciding with the tuples.
Of course, I could just use a loop, but I want a smarter solution that would be faster and cleaner.
Minimal Working Example
import pandas as pd
df = pd.DataFrame(
{
'A': ['a', 'b', 'c', 'd', 'a', 'd', 'a', 'c'],
'B': [4, 2, 2, 1, 3, 4, 3, 2],
}
)
rows_to_remove = [('a', 4), ('c', 2), ('d', 4), ('a', 3)]