I have a DataFrame where I want to filter rows appling a list of condition applicable simultaneously on two columns. For example:
pd.DataFrame({'A':['Y','Y','Y','Z','Z'],'B':[1,2,2,3,4],'C':[100,200,234,358,4243]})
A B C
0 Y 1 100
1 Y 2 200
2 Y 2 234
3 Z 3 358
4 Z 4 4243
filter_on=[('Y',2),('Z',4)]
When filtering where A and B have any of the couple of values at filter_on , I should get following DataFrame:
A B C
1 Y 2 200
2 Y 2 234
4 Z 4 4243