Mutate Chart Data with Streamlit

You can add data to an existing chart in a similar manner

df1 = pd.DataFrame({“A”: [94, 25, 70, 90, 26], “B”: [17, 46, 59, 195, 126], “C”: [96, 267, 214, 209, 31]})

df2 = pd.DataFrame({“A”: [69, 42, 51], “B”: [192, 136, 33], “C”: [145, 263, 125]})

st.bar_chart(df1) st.bar_chart(df2) chart = st.bar_chart(df1) chart.add_rows(df2)

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy