✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Direct dropdown to dictionary keys

I have a dictionary that contains 4 keys, each representing a crop belt in the USA.

dict_keys(['corn', 'soybeans', 'winterwheat', 'springwheat'])

Each dictionary entry is a pandas dataframe that has 3 columns: time, a variable for temperature, and a variable for precipitation. For example, here the first key, ‘corn’:

time	2m_temp_prod	total_precip_prod
0	2020-09-17 00:00:00	299.346777	0.000000
1	2020-09-17 06:00:00	294.039512	0.191070
2	2020-09-17 12:00:00	292.959274	0.155765
3	2020-09-17 18:00:00	301.318046	0.421768
4	2020-09-18 00:00:00	300.623567	0.363572

Now, I am able to plot this data with ease and even add a dropdown option to switch between plotting column 2 and column 3. Next, I want to add a second dropdown option to switch between the dictionary entries. So far I have found no way to do this. For example, the first dropdown would have the 4 different dict keys as options and points to the specific dataframes within the key. The second dropdown would then be just switching between the two columns with each key. How would I go about doing this?