Activity 2#
Download the data for the assignment from here. This dataset contains population and income data for Census tracts in Lane County, Oregon. In this activity, we will use the geopandas
package to do some basic analysis on this dataset.
Note
B01003_001
is population and B19301_001
is household income.

Activate the
.gds
Python environment by opening an Anaconda Prompt (miniconda3) (Windows) or Terminal (macOS). Then, on Windows:
.gds\Scripts\activate
Or, on macOS:
source .gds/bin/activate
Note
Make sure you run this command from the same directory as the .gds
environment folder.
Open a Jupyter Notebook by running:
jupyter notebook
Tip
If you run this command from your course folder, your .ipynb
assignment will automatically be saved there.
Task 1 (5 points)#
Import the geopandas
package and read the shapefile. Write some code that prints the following information:
Number of columns
Number of rows
The maximum
B01003_001
valueThe minimum
B19301_001
valueThe mean
B19301_001
value
Task 2 (5 points)#
Reproject the shapefile to a
projected coordinate system
(i.e. spatial units are in meters)Make a new column that contains population density (in km2).
What is the min, mean, and max population density?
Task 3 (5 points)#
Make a choropleth map showing population density
Click to reveal hint
The following guide may be helpful: https://geopandas.org/en/stable/docs/user_guide/mapping.html
Make a choropleth map showing household income.
Customize both plots so they look more presentable.
Important
Save your notebook locally in both .ipynb
and .pdf
formats but only submit the pdf to Canvas.