Skip to content

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 states if not given, and to clip the final result.

None
states Optional[Union[str, List[str]]]

State name(s)/abbreviation(s)/FIPS code(s) to load. Derived from aoi if omitted (aoi is then required).

None
level str

Standard geometry level (:data:pycensus.geometry_levels.STANDARD_LEVELS); "acs/acs3" is available down to "blockgroup".

'tract'
year Union[int, str]

Vintage year, or "latest".

'latest'
api_key Optional[str]

Census API key. Resolved via :func:pycensus.api_keys.resolve_api_key if not given.

None
cache_dir Optional[str]

Root of pyCensus' parquet cache. Defaults to :func:pycensus.cache.default_cache_dir.

None
cache bool

If False, bypass the cache entirely -- always fetch fresh and don't persist the result.

True

Returns:

Type Description
GeoDataFrame

GeoDataFrame with GEOID, geometry, and one acs3_-prefixed

GeoDataFrame

column per logical column in :data:pycensus.usa.acs3.schema.SCHEMA.

Raises:

Type Description
ValueError

If neither states nor aoi is given.