Skip to content

Instantly share code, notes, and snippets.

@toyeiei
Last active September 7, 2022 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toyeiei/e0dddef67e65f499e212b799652eca20 to your computer and use it in GitHub Desktop.
Save toyeiei/e0dddef67e65f499e212b799652eca20 to your computer and use it in GitHub Desktop.
streamlit_sample_app_2022SEP07
import streamlit as st
import pandas as pd
st.title('🎈 App Name')
st.sidebar.header("Input")
st.subheader("URL")
url = 'https://raw.githubusercontent.com/dataprofessor/data/master/iris.csv '
url_input = st.sidebar.text_input("URL:", url)
if url_input:
st.header("Output")
st.info(f"The GitHub url of your data is: {url_input}")
df = pd.read_csv(url_input)
st.write(df)
col_name = df.columns[-1]
st.write(col_name) # check column name we want
df2 = df.groupby(col_name).mean()
st.bar_chart(df2)
else:
st.subheader("Enter your input")
st.error("Waiting for your input.")
# radio button example
st.header('Sandbox')
species = st.radio('What is your favorite class?', ('setosa', 'virginica', 'versicolor'))
st.write(species)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment