Last active
September 7, 2022 16:20
-
-
Save toyeiei/e0dddef67e65f499e212b799652eca20 to your computer and use it in GitHub Desktop.
streamlit_sample_app_2022SEP07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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