I have around 20 dropdown boxes containing unique column values (str) for fungi characteristics. Is there a way to label them, e.g. ‘colour’, ‘gill-size’?
import ipywidgets as widgets
# Create a dictionary of dropdowns, one for each variable
dropdowns = {}
for col in df.columns:
options = list(df[col].unique())
options.append
options.append('unknown')
dropdowns[col] = widgets.Dropdown(
options=options,
value=df[col].iloc[0]
)
# Display the dropdowns
(widgets.VBox(list(dropdowns.values())))