Population Distribution Workflow using Census API in Jupyter Notebook: Dynamic Map of Census Tracts in Boone County, KY, 2000
Principal Investigator(s): View help for Principal Investigator(s) Cooper Goodman, Texas A&M University; Nathanael Rosenheim, Texas A&M University; Wayne Day, Texas A&M University; Donghwan Gu, Texas A&M University; Jayasaree Korukonda, Texas A&M University
Version: View help for Version V1
Name | File Type | Size | Last Modified |
---|---|---|---|
CensusAPI_PopulationDistributionMap_Shapefiles_2020-07-31 | 07/31/2020 11:30:AM | ||
|
text/csv | 3 KB | 07/31/2020 07:10:AM |
|
text/html | 216.5 KB | 07/31/2020 07:10:AM |
|
text/plain | 408 KB | 07/31/2020 06:51:AM |
|
application/pdf | 1.2 MB | 07/31/2020 07:08:AM |
Project Citation:
Project Description
The Python code was developed in Google Colaboratory, or Google Colab for short, which is an Integrated Development Environment (IDE) of JupyterLab and streamlines package installation, code collaboration, and management. The Census API is used to obtain population counts from the 2000 Decennial Census (Summary File 1, 100% data). Shapefiles are downloaded from the TIGER/Line FTP Server. All downloaded data are maintained in the notebook's temporary working directory while in use. The data and shapefiles are stored separately with this archive. The final map is also stored as an HTML file.
The notebook features extensive explanations, comments, code snippets, and code output. The notebook can be viewed in a PDF format or downloaded and opened in Google Colab. References to external resources are also provided for the various functional components.
The notebook features code that performs the following functions:
- install/import necessary Python packages
- download the Census Tract shapefile from the TIGER/Line FTP Server
- download Census data via CensusAPI
- manipulate Census tabular data
- merge Census data with TIGER/Line shapefile
- apply a coordinate reference system
- calculate land area and population density
- map and export the map to HTML
- export the map to ESRI shapefile
- export the table to CSV
The notebook can be modified to perform the same operations for any county in the United States by changing the State and County FIPS code parameters for the TIGER/Line shapefile and Census API downloads. The notebook can be adapted for use in other environments (i.e., Jupyter Notebook) as well as reading and writing files to a local or shared drive, or cloud drive (i.e., Google Drive).
Scope of Project
Python Version 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
requests version: 2.23.0
pandas version: 1.0.5
geopandas version: 0.8.1
folium version: 0.8.3
Methodology
U.S. Census Bureau (2010). TIGER/Line: Census Tract Shapefiles 2000. Data retrieved from ftp://ftp2.census.gov/geo/tiger.
Related Publications
Published Versions
Found a serious problem with the data, such as disclosure risk or copyrighted content? Let us know.
This material is distributed exactly as it arrived from the data depositor. ICPSR has not checked or processed this material. Users should consult the investigator(s) if further information is desired.