How to compare data/scores of multiple products

Hey @gplm_beginner, you’re free to use one of the many graph libraries Streamlit supports (Matplotlib/Seaborn, Altair, Plotly, Bokeh to name a few).

For example here is an interactive one using Plotly Express Grouped bar chart with st.plotly_chart:

import streamlit as st
import pandas as pd
import plotly.express as px

# continue loading the data with your excel file, I was a bit too lazy to build an Excel file :)
df = pd.DataFrame(
    [["Product A", 5.6, 7.8, 5], ["Product B", 5.8, 7.2, 4.9]],
    columns=["Product", "Comfort", "Sound", "Calls"]
)

fig = px.bar(df, x="Product", y=["Comfort", "Sound", "Calls"], barmode='group', height=400)
# st.dataframe(df) # if need to display dataframe
st.plotly_chart(fig)

Afterwards it becomes more of a reading the graph library documentation (notably because I guess you’d prefer to group by score rather than product?) though rather than a Streamlit question…but feel free to edit the code and see the graph result in Streamlit in realtime to better understand what happens when you edit things!

Good luck !
Fanilo

4 Likes