Spaces:
Sleeping
Sleeping
Commit ·
88c3e60
1
Parent(s): a200a57
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,17 +9,26 @@ df = pd.read_csv('spices_by_cuisine_with_all_flavors.csv', index_col=0)
|
|
| 9 |
|
| 10 |
st.dataframe(df)
|
| 11 |
|
| 12 |
-
pivot = df.drop(columns=['Flavor Description']).
|
| 13 |
|
| 14 |
-
|
| 15 |
for col in pivot.columns:
|
| 16 |
filter = pivot[col] == 1
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
option = st.selectbox(
|
| 21 |
'How would you like to be contacted?',['test', 'hello'])
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
st.write('You selected:', option)
|
| 24 |
|
| 25 |
|
|
|
|
| 9 |
|
| 10 |
st.dataframe(df)
|
| 11 |
|
| 12 |
+
pivot = df.drop(columns=['Flavor Description']).set_index("Spice")
|
| 13 |
|
| 14 |
+
cuisines = {}
|
| 15 |
for col in pivot.columns:
|
| 16 |
filter = pivot[col] == 1
|
| 17 |
+
cuisines[col] = pivot[filter].index.to_list()
|
| 18 |
+
|
| 19 |
+
spices = {}
|
| 20 |
+
pivot_t = pivot.T
|
| 21 |
+
for col in pivot_t.columns:
|
| 22 |
+
filter = pivot_t[col] == 1
|
| 23 |
+
spices[col] = pivot_t[filter].index.to_list()
|
| 24 |
|
| 25 |
|
| 26 |
option = st.selectbox(
|
| 27 |
'How would you like to be contacted?',['test', 'hello'])
|
| 28 |
|
| 29 |
+
option = st.selectbox(
|
| 30 |
+
'How would you like to be contacted?',cuisines.keys())
|
| 31 |
+
|
| 32 |
st.write('You selected:', option)
|
| 33 |
|
| 34 |
|