adrianpierce commited on
Commit
c1f5793
·
1 Parent(s): c296fbd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -56,7 +56,9 @@ with col3:
56
  st.write(f'{select_cuisine_sim} is most similar to:', cuisine_similarity[select_cuisine_sim].sort_values(ascending=False).index[1:11].to_list())
57
 
58
 
59
-
 
 
60
 
61
  # Create a graph
62
  G = nx.Graph()
@@ -144,7 +146,7 @@ for node in G.nodes():
144
  node_trace_spices['hovertext'] += tuple([hover_text])
145
 
146
  # Create the network graph figure with updated hover information
147
- fig = go.Figure(data=[edge_trace, node_trace_cuisines, node_trace_spices],
148
  layout=go.Layout(
149
  title="Network Graph of Cuisines and their Spices",
150
  titlefont_size=16,
@@ -155,4 +157,4 @@ fig = go.Figure(data=[edge_trace, node_trace_cuisines, node_trace_spices],
155
  yaxis=dict(showgrid=False, zeroline=False, showticklabels=False))
156
  )
157
 
158
- st.plotly_chart(fig, use_container_width=True)
 
56
  st.write(f'{select_cuisine_sim} is most similar to:', cuisine_similarity[select_cuisine_sim].sort_values(ascending=False).index[1:11].to_list())
57
 
58
 
59
+ count = pd.DataFrame(pivot.T.sum().sort_values(ascending=False).reset_index().rename(columns={0: "Count"}))
60
+ fig_bar = px.bar(count, x="Spice", y="Count")
61
+ st.plotly_chart(fig_bar, use_container_width=True)
62
 
63
  # Create a graph
64
  G = nx.Graph()
 
146
  node_trace_spices['hovertext'] += tuple([hover_text])
147
 
148
  # Create the network graph figure with updated hover information
149
+ fig_graph = go.Figure(data=[edge_trace, node_trace_cuisines, node_trace_spices],
150
  layout=go.Layout(
151
  title="Network Graph of Cuisines and their Spices",
152
  titlefont_size=16,
 
157
  yaxis=dict(showgrid=False, zeroline=False, showticklabels=False))
158
  )
159
 
160
+ st.plotly_chart(fig_graph, use_container_width=True)