-
-
Save duncangh/51dd162d7fd6cedca32a92ecbb4bf24c to your computer and use it in GitHub Desktop.
This demonstrates the st.cache function
This file contains hidden or 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 | |
| # Reuse this data across runs! | |
| read_and_cache_csv = st.cache(pd.read_csv) | |
| BUCKET = "https://streamlit-self-driving.s3-us-west-2.amazonaws.com/" | |
| 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]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment