Saif-bio commited on
Commit
0462054
·
verified ·
1 Parent(s): ec96151

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -14,7 +14,7 @@ def app():
14
  st.title("Pizza Sales Data Analysis Dashboard")
15
  df = load_data()
16
 
17
- total_orders = df['order_id'].drop_duplicates() #function which can calculate the number of unique values
18
  total_revenue = df['total_price'].sum() #function which can sum the column
19
  most_popular_size = df['pizza_size'].value_counts().idxmax() #function which can get the maximum value
20
  most_frequent_category = df['pizza_category'].value_counts().idxmax() #function which can count of value of each product
@@ -25,6 +25,7 @@ def app():
25
  st.sidebar.metric("Most Popular Size", most_popular_size)
26
  st.sidebar.metric("Most Popular Category", most_frequent_category)
27
  st.sidebar.metric("Total Pizzas Sold", total_pizzas_sold)
 
28
  plots = [
29
  {"title": "Top Selling Pizzas (by Quantity)", "x": "pizza_name", "y": "quantity", "top": 5}, #Write the appropriiate column as per the title given
30
  {"title": "Quantity of Pizzas Sold by Category and Time of the Day", "x": "order_time", "hue": "pizza_category"}, #Write the appropriiate column as per the title given
 
14
  st.title("Pizza Sales Data Analysis Dashboard")
15
  df = load_data()
16
 
17
+ total_orders = df['order_id'].value_counts() #function which can calculate the number of unique values
18
  total_revenue = df['total_price'].sum() #function which can sum the column
19
  most_popular_size = df['pizza_size'].value_counts().idxmax() #function which can get the maximum value
20
  most_frequent_category = df['pizza_category'].value_counts().idxmax() #function which can count of value of each product
 
25
  st.sidebar.metric("Most Popular Size", most_popular_size)
26
  st.sidebar.metric("Most Popular Category", most_frequent_category)
27
  st.sidebar.metric("Total Pizzas Sold", total_pizzas_sold)
28
+ st.sidebar.metric("Total Orders", total_orders)
29
  plots = [
30
  {"title": "Top Selling Pizzas (by Quantity)", "x": "pizza_name", "y": "quantity", "top": 5}, #Write the appropriiate column as per the title given
31
  {"title": "Quantity of Pizzas Sold by Category and Time of the Day", "x": "order_time", "hue": "pizza_category"}, #Write the appropriiate column as per the title given