Greetings,
I have a series of lab label/factor pairs in a list of tuples. I need to work through the factorPotency list retaining the label/factor pairs with the highest factor value in the event of duplicate label names e.g. 'chain'.
Could someone assist with this query?
I have a series of lab label/factor pairs in a list of tuples. I need to work through the factorPotency list retaining the label/factor pairs with the highest factor value in the event of duplicate label names e.g. 'chain'.
Could someone assist with this query?
Code:
factorPotency = [('chain', 100), ('compound', 100), ('sequence', 95), ('crystcont', 80), ('sequence', 75), ('chain', 67)]
Code:
Desired output:
effectiveFactorPotency = [('chain', 100), ('compound', 100), ('sequence', 95), ('crystcont', 80)]