I have a list such that
l = ['xyz','abc','mnq','qpr']
These values are weighted so that xyz>abc>mnq>qpr
I have a pandas dataframe with a column that has sets of values.
COL_NAME
0 set(['xyz', 'abc'])
1 set(['xyz'])
2 set(['mnq','qpr'])
Now I want to select the highest values in the sets, so that after applying the user-defined function, I stay with
COL_NAME
0 set(['xyz'])
1 set(['xyz'])
2 set(['mnq'])
Is there an elegant way to do this without resorting to the weights dictionary?
source
share