Data App Lab
This is an in-class lab — there is nothing to submit. You build a Streamlit app for the California housing dataset, then deploy it to Streamlit Cloud, applying what you learned in the Data App Tutorial.
Setup
Download housing.csv.zip, unzip it, and move housing.csv into the my-streamlit folder from the tutorial. Create a new file app-housing.py there and run it with:
uv run streamlit run app-housing.pyEach row of housing.csv is a California district in 1990. The columns you need are:
latitudeandlongitude— the location, used byst.map()median_house_value— the median house value in US dollars (from 14,999 to 500,001)median_income— the median income in tens of thousands of US dollarsocean_proximity— the location type:NEAR BAY,<1H OCEAN,INLAND,NEAR OCEAN, orISLAND
Part I: Build the App
Your app needs the following, with your own name in the title:
- A title: California Housing Data (1990) by [Your Name].
- A slider labeled Minimal Median House Value that ranges from 0 to 500001 with a default of 200000. Show only the districts whose
median_house_valueis at least the slider value. - A subheader: See more filters in the sidebar:.
- In the sidebar, a multiselect widget labeled Choose the location type that filters by
ocean_proximity. All location types are selected by default. - In the sidebar, a radio button widget labeled Choose income level with three options. Use an
ifstatement to filter the dataframe based on the selection — see the st.radio example:- Low:
median_income≤ 2.5 - Medium: 2.5 <
median_income< 4.5 - High:
median_income≥ 4.5
- Low:
- A map of the filtered districts.
- Below the map, a histogram of
median_house_valuefor the filtered districts with 30 bins.
The top of your app and the sidebar should look like this:

The map shows the filtered districts:

The histogram goes below the map:

Part II: Deploy the App
Deploy the app to Streamlit Cloud as a second app from the same repository, following Deploy the App in the tutorial:
- In GitHub Desktop, commit
app-housing.pyandhousing.csvand click Push origin. - On Streamlit Cloud, create a new app from the same repository, set the main file path to
app-housing.py, and set the Python version to 3.14 under Advanced settings.
Data App Tutorial
In this tutorial, you build a Streamlit app that explores a world cities dataset, then deploy it to Streamlit Cloud so anyone can use it.
In-Class Group Exercise
Form a team of four or more. Pick any dataset from Kaggle, decide what dashboard a real business would build on it, then build it in Streamlit, deploy it…