Skip to content

Instantly share code, notes, and snippets.

@stevenkolawole
Created August 5, 2021 17:30
Show Gist options
  • Select an option

  • Save stevenkolawole/104d0234f9f02eebf34d7dd725dfbcc4 to your computer and use it in GitHub Desktop.

Select an option

Save stevenkolawole/104d0234f9f02eebf34d7dd725dfbcc4 to your computer and use it in GitHub Desktop.
import numpy as np
import plotly.express as px
import streamlit as st
st.title('Distribution Tester')
st.write('Pick a distribution from the list and we shall draw \
the line chart from a random sample from the distribution')
keys = ['Normal','Uniform']
dist_key = st.selectbox('Which distribution do you want to plot?', keys)
if dist_key == 'Normal':
nums = np.random.randn(1000)
elif dist_key == 'Uniform':
nums = np.array([np.random.randint(100) for i in range(1000)])
# Display user
fig = px.line(nums)
st.plotly_chart(fig)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment