logo

... streamlit: line charts



Notes

This is the app.py that we end up with at the end of the video;

import streamlit as st
import numpy as np

st.title("Simulation[tm]")
st.write("Here is our super important simulation")

x = st.slider('Slope', min_value=0.01, max_value=0.10, step=0.01)
y = st.slider('Noise', min_value=0.01, max_value=0.10, step=0.01)

st.write(f"x={x} y={y}")
values = np.cumsum(1 + np.random.normal(x, y, (100, 10)), axis=0)
st.line_chart(values)

Note that we run this app from the command line by running;

streamlit run app.py

Feedback? See an issue? Something unclear? Feel free to mention it here.



If you want to be kept up to date, consider signing up for the newsletter.