I have the following row based dataset in pandas and want to filter modules that fulfill multiple critera, e.g. all modules with (setting='Foo' and value=2) and (setting='bar' and value=1)
Currently i am getting seperatly the modules for each criteria and then building the intersection of all single results. Is there a more efficient way, e.g. to transfer the dataset into a column based dataset and then filtering with one query (setting_foo=2 and settting_bar=3)
module setting value
-----------------------------------------
A Foo 2
A bar 1
B Foo 3
B bar 1
...
Desired output for this example would be module A because module B fulfills bar=1 but not foo=2