Created
October 2, 2019 06:17
-
-
Save tvst/713f5804ab45b9430866ee639d8568f1 to your computer and use it in GitHub Desktop.
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.cache | |
def get_data(): | |
return pd.read_csv('https://datahub.io/core/gdp/r/gdp.csv') | |
'# World GDP' | |
df = get_data() | |
min_year = int(df['Year'].min()) | |
max_year = int(df['Year'].max()) | |
countries = df['Country Name'].unique() | |
'## By country' | |
country = st.selectbox('Country', countries) | |
df[df['Country Name'] == country] | |
'## By year' | |
year = st.slider('Year', min_year, max_year) | |
df[df['Year'] == year] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment