Question 10: CSV|Chart

You are the manager of a coffee shop tracking weekly sales for five popular beverages: Espresso, Cappuccino, Latte, Mocha, and Americano. Input the weekly sales for each beverage, display the data in a table, and create a bar chart to see which beverage is the top seller.

  1. Set up the Streamlit app:

    • Import streamlit, pandas, and plotly.express.
    • Set the app title as “Coffee Shop Weekly Sales Analysis.”
  2. Input sales data:

    • Use st.number_input to enter sales for Espresso, Cappuccino, Latte, Mocha, and Americano.
  3. Display data:

    • Store the beverage names and sales in a pandas DataFrame.
    • Use st.table to display the data.
  4. Create a bar chart:

    • Use Plotly Express to visualize the sales data.
    • Show the chart using st.plotly_chart.
  5. Run the app:

    • Test the app locally using streamlit run app.py.
Write what you are looking for, and press enter to begin your search!