adrianpierce commited on
Commit
77679d4
·
1 Parent(s): cab2b19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -9,7 +9,7 @@ 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
  cuisines = {}
15
  for col in pivot.columns:
@@ -17,19 +17,16 @@ for col in pivot.columns:
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
 
35
  # Create a graph
 
9
 
10
  st.dataframe(df)
11
 
12
+ pivot = df.drop(columns=['Flavor Description']).sort_index()
13
 
14
  cuisines = {}
15
  for col in pivot.columns:
 
17
  cuisines[col] = pivot[filter].index.to_list()
18
 
19
  spices = {}
20
+ pivot_t = pivot.T.sort_index()
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?',cuisines.keys())
28
 
29
+ st.write('The top 10 ingredients in this cuisine are:', cuisines[option])
30
 
31
 
32
  # Create a graph