NSAPH-Data-Processing / us_census_zcta_time_series

Using census package to extract acs5 data
MIT License
0 stars 0 forks source link

change year tagging and pull data for 2019/2020 #27

Open nish-08 opened 1 year ago

audiracmichelle commented 1 year ago

as explained in the readme:

The American Community Survey (ACS) provides two main sets of data products:

1-year estimates: These are produced every year and are based on data collected over a 12-month period. These estimates are available for geographic areas with populations of 65,000 or more. The 1-year data provides the most current data but may have more variance due to the smaller sample size.

5-year estimates: As you pointed out, these are produced for 5-year periods, such as 2012-2016 or 2013-2017, and so on. They are available for all geographic areas, including small areas like census tracts and block groups. The 5-year data provides a larger sample size, leading to more stable and reliable estimates, especially for smaller geographic areas.

When you're using the census Python package and you're referring to the acs5 endpoint, you're typically accessing the 5-year estimates. If you're interested in data for a specific 5-year period, you need to specify that in your request. For instance, the 2012-2016 data would be represented as 2016 in the API, as the last year of the period is typically used to denote the dataset.

audiracmichelle commented 1 year ago

we will have to change this line in the script

output_file = f"{args.outputprefix}{args.year}"

to

output_file = f"{args.outputprefix}{args.year - 2}"