Tutorials
Short, hands-on guides to working with census data
Each tutorial takes 30 minutes or less. If you are new to census data, start with Census 101. Then pick the R track or the Python track. Both tracks cover the same ground, so you only need one.
Before you begin either coding track, request a free Census API key. It arrives by email within a few minutes.
Much of this material draws on Kyle Walker’s free online book, Analyzing US Census Data: Methods, Maps, and Models in R. It is an excellent next step whichever language you use.
| Tutorial | Description |
|---|---|
| Census 101: How Census Data Is Organized | Start here. Learn the difference between the decennial census and the ACS, how census geographies nest inside each other, and how to download a table from data.census.gov. |
| Census Data in R, Part 1: Getting Tables with tidycensus | Use the tidycensus package to pull ACS and 2020 decennial census data for North Carolina counties and Mecklenburg County census tracts. |
| Census Data in R, Part 2: Mapping with tidycensus and sf | Add geometry to your tidycensus requests and map census variables for North Carolina counties and Mecklenburg County census tracts. |
| Census Data in Python, Part 1: The Census API with requests and Polars | Call the Census API directly with requests, load the results into Polars, and build a reusable function for pulling ACS and decennial data. |
| Census Data in Python, Part 2: Mapping with pygris and GeoPandas | Download census boundaries with pygris, join them to your Census API results, and map North Carolina counties and Mecklenburg County census tracts with GeoPandas. |
No matching items