Write your topic title as a question. This helps with search. Provide as much context as possible.
November 4, 2021, 1:20pm
@serwatkathomas! If you’re using the Open Census Data from SafeGraph, that data is all at the Census Block Group (CBG) level, not ZIP level. However, a few Community members have previously circulated some useful Python code and tutorials to cross reference most CBG to ZCTA to Zip code conversion. Check out this notebook:
Here’s another one that might be helpful:
This file has been truncated.
"# Matching CBGs to ZCTAs for COVID-19 research"
"The code below matches CBGs to ZCTAs in a many-to-one fashion using CBG centroids: \n",
" A CBG is assigned to a ZCTA if that CBG's centroid is within the ZCTA's polygon.\n",
"This strategy is not perfect but it does allow fast matching of CBG data to ZCTA level COVID-19 data. Below, ZIP code and ZCTA are used interchangeably for simplicity but ZCTAs are <i>always</i> the areal unit of analysis, except for NYC which combines ZCTAs in their COVID-19 reporting. Notably, this strategy will work for any type of polygon, thus NYC's unique data reporting can be easily accommodated.\n",