I have a function that looks like this that takes a dictionary as an argument. The dictionary looks like this:
d = {'skill_1':3, 'skill_2':2, 'skill_5':5, 'skill_7':3}
The function i have is a function that takes this dictionary, and then looks into a dataframe for the people that have a value greater or equal that the one in the dictionary, for the skills mentioned. It looks like this:
skill_0 skill_1 skill_2 skill_3 skill_4 skill_5 skill_6 skill_7
0 5 3 1 4 2 3 4 2
1 3 2 1 3 2 2 5 1
2 3 1 3 3 3 1 3 4
3 3 5 4 5 5 5 3 3
4 5 4 3 2 4 3 4 1
I want to receive this argument from a widget(or using 2 widgets and then combining the values of the two widgets into a dictionary).
I have tried something like
s = ['skill_0', 'skill_1', 'skill_2', 'skill_3', 'skill_4', 'skill_5', 'skill_6', 'skill_7']
widgets.SelectMultiple(options=[f'{i}:{n}' for i in s for n in range(1,6)], value=('skill_3:1',))
But i cant manage to retrive the value from the widget and make a dictionary (i tried with eval
too.). Also, the list like this looks visually ugly. Is there any way to achieve this?