Key Points
Introduction to Foundations
- Python (in Jupyter notebooks on Google Colab) is for repeatable data work; QGIS is for looking at data and making maps
- Save your own copy of each notebook, and run cells in order with Shift + Enter
- Colab sessions and files are temporary; data is always read from the web
- This module prepares you for every other module in the curriculum
Python Basics
- Run cells with Shift + Enter, in order, and read the last line of any error first
- Values have types (
int,float,str,bool); convert numbers stored as text before doing math - Lists keep values in order (from position 0); dictionaries look values up by key
-
if/elif/elsemake decisions;forloops repeat work; functions package work for reuse
Working with Data
- pandas reads tables from the web into DataFrames with
pd.read_csv(url) - Check data types first; keep identifiers such as FIPS codes as text
- Select, filter, sort, calculate and group with a few lines of code, no loops needed
- Pick the chart that answers the question, and always label it
Geospatial Python Basics
- A GeoDataFrame is a pandas DataFrame plus a
geometrycolumn;gpd.read_file()reads it from the web - Check
.crsfirst; useto_crs()to a projected CRS in meters before measuring, andset_crs()only to label missing CRS information - Attribute joins match IDs (make them the same type first); spatial joins match locations (same CRS first)
- A raster is a grid of cells with a CRS, a cell size and a no-data value; rasterio reads it into a NumPy array
Map Your County in Python
- Join, then check: row counts and unmatched rows
- Clean special codes and zero denominators before computing rates
- Project to meters, pick classes that suit the distribution, and show missing data clearly
- A finished map has a title, legend with units, scale bar, north arrow and source line
Getting Started with QGIS: Your First Map
- Add Vector Layer with the HTTP(S) protocol (Type HTTP/HTTPS/FTP) loads data straight from a web address.
- Use the Check lines: Zoom to Layer and layer order solve most “missing data” problems.
- The attribute table holds the data behind every styling choice.
- Use Categorized for categories and Graduated for numbers, and compare classification modes.
- A Print Layout combines the map with its title, legend, scale bar, north arrow and source.
- Save the project often; export layouts as PNG or PDF.
- Check layer and project coordinate systems before measuring anything.
Tables, Joins and Selections in QGIS
- A table join attaches a table to features by a shared ID; check that ID fields have the same type first
- Census GEOIDs are codes: store them as text so leading zeros survive
- After a join, select
"field" IS NULLto find unmatched features - Rates need the right denominator; division by zero gives NULL, and Census codes such as -666666666 must be replaced with NULL
- Selection highlights features, Filter hides the others, and Save Features As makes joins and virtual fields permanent
Map Your County in QGIS
- Join, then check for unmatched features
- Clean special codes and zero denominators before computing rates
- Pick classes that suit the distribution, and show missing data as its own class
- A finished map has a title, legend with units, scale bar, north arrow and source line