How to remove duplicate values in a dictionary?

I want to remove duplicate values inside a dictionary. Let’s say this is my dictionary: dict = {‘X’ : [ {id : 1, Name: ‘RandomName’, Brand: ‘RandomBrand’}, {id: 2, Name: ‘RandomName2’, Brand: ‘RandomBrand2’} ], ‘Y’: [ {id: 1, Name: ‘RandomName’, Brand: ‘RandomBrand’}, {id: 1, Name: ‘RandomName’, Brand: ‘RandomBrand’} ] } I want to have this… Read More How to remove duplicate values in a dictionary?

filter dataframe of frozensets if they have a certain elemnet

I would like to filter a datframe that has association rules results. I want antecedents that contain an element like H or L in my case. The antecedents are frozenset types. I tried Hrules but it is not working. Hrules=fdem_rules[‘H’ in fdem_rules[‘antecedents’]] Hrules=fdem_rules[frozenset({‘H’}) in fdem_rules[‘antecedents’]] did not work In the following example, I need only… Read More filter dataframe of frozensets if they have a certain elemnet