I have a dataframe with two columns (‘all_words’, ‘tags’) that I want to use respectively for the label and value of the dropdown.
all_words = df[‘words’]
tags = df[‘tags’]
dcc.Dropdown(
id=‘dropdown_value’,
options=[{‘label’: i,‘value’: x} for i in all_words, for x in tags],
)
This code doesn’t work, and my mistake may be obvious to someone else. I often see cases of using the same variable for both, e.g. [{‘label’: i,‘value’: i} for i in all_words], but never for different variables.
Anyone able to help?