I have created a data structure for my purposes, which is a simple dictionary with a list of values as data:

```
{'Procedure_name': ('compound', 'hardware', 'tempval', 'colorval', 'energyval'), .....}

```

imagine a sequence of procedures, where you mix 2 compounds, and record temperature variation, potential energy, variance in color and such, this is what each entry in the dictionary represent.

What would be the best way to achieve a filter implementation? This is an example of what would like to achieve. My filter mostly will aim at use just few parameters (like compound, hardware), either as single or as combined

```
dataset = {'Att1_Cl': ('carb', 'Spectrometer_v1', '33', '0.25', '445'), 
    'Att1_Na': ('carb', 'Spectrometer_v1', '34.2', '0.21', '401'), 
    'Att1_Si': ('alc', 'Photometer_V2', '32.1', '0.43', '521'), 
    'Att1_Cr': ('carb', 'Photometer_V3', '32.5', '0.49', '511')}

def filter_data(filter)
    ....
    return filtered_data # the entry from the dictionary that satisfy the condition

```

As output examples:

```
print (filter_data (['carb']))

Att1_Cl
('carb', 'Spectrometer_v1', '33', '0.25', '445')
Att1_Na
('carb', 'Spectrometer_v1', '34.2', '0.21', '401') 
Att1_Cr
('carb', 'Photometer_V3', '32.5', '0.49', '511')

print (filter_data (['Spectrometer_v1']))

Att1_Cl
('carb', 'Spectrometer_v1', '33', '0.25', '445')
Att1_Na
('carb', 'Spectrometer_v1', '34.2', '0.21', '401')

print (filter_data (['carb', 'Photometer_V3']))

Att1_Cr
('carb', 'Photometer_V3', '32.5', '0.49', '511')

```

I was thinking to use a list as possible parameters, and compare each entry in the dataset; but I can't find an efficient way to get this done. This is my first approach

```
def filter_data(filter):

    for procedure in dataset:
        single_dataset = dataset[procedure]
        if filter in single_dataset:
            print(procedure)
            print(single_dataset)

```

This works if I have one entry, but if I have multiple entry in the filter list; I have to make more than one pass on the dataset, and this is not really efficient nor scalable, in case I will add more parameters to my data structure.
The other alternative that I had in mind, was to save pre-made filters, that get called via the filter parameter passed to the function, but this is a nightmare from the perspective of maintain code, since each change in the filter has to be hardcoded.