pycensus.census.countries.usa.acs3.loader¶
Loader for the ACS 3-year estimates (historical, through 2013), returning a common-schema GeoDataFrame.
Technical aspects
For each requested state, :func:load reads as much as it can from
pyCensus' parquet cache (:mod:pycensus.cache, one file per
level/region shared across every US source) and only fetches the
columns actually missing via :func:pycensus.usa.api.fetch_variables,
summing each logical column's raw codes with Polars before merging back
into the cache. Output columns are prefixed acs3_ so the result works
directly with :meth:geohierarchy.GeoHierarchy.add_level (using
SCHEMA.aggregations() for the agg argument) and with the
gdf.acs3[...] accessor registered in :mod:pycensus.usa.acs3.
Note
ACS 3-year estimates were discontinued after 2013. This is a historical dataset.
load(aoi=None, states=None, level='tract', year='latest', api_key=None, cache_dir=None, cache=True)
¶
Load ACS 3-year estimates as a common-schema GeoDataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
Optional[GeoDataFrame]
|
Area of interest. Used to auto-detect |
None
|
states
|
Optional[Union[str, List[str]]]
|
State name(s)/abbreviation(s)/FIPS code(s) to load. Derived
from |
None
|
level
|
str
|
Standard geometry level
(:data: |
'tract'
|
year
|
Union[int, str]
|
Vintage year, or |
'latest'
|
api_key
|
Optional[str]
|
Census API key. Resolved via
:func: |
None
|
cache_dir
|
Optional[str]
|
Root of pyCensus' parquet cache. Defaults to
:func: |
None
|
cache
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with |
GeoDataFrame
|
column per logical column in :data: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |