Skip to content

Instantly share code, notes, and snippets.

Created September 30, 2019 18:52
What would you like to do?
This demonstrates the st.cache function
import streamlit as st
import pandas as pd
# Reuse this data across runs!
read_and_cache_csv = st.cache(pd.read_csv)
data = read_and_cache_csv(BUCKET + "labels.csv.gz", nrows=1000)
desired_label = st.selectbox('Filter to:', ['car', 'truck'])
st.write(data[data.label == desired_label])
Copy link

You can run this gist directly from the command line with:

pip install --upgrade streamlit
streamlit run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment