Skip to content

pycensus.census.countries.usa.acs5

ACS 5-year estimates: American Community Survey source.

Importing this module registers the gdf.acs GeoDataFrame accessor (see :mod:pycensus.accessors). Use :func:load to fetch data.

load(aoi=None, states=None, level='tract', year='latest', api_key=None, cache_dir=None, cache=True)

Load ACS 5-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/acs5" is available down to "blockgroup".

'tract'
year Union[int, str, None]

Vintage year, "latest"/None (latest year that supports level), or a year outside ACS5's published range (linearly interpolated between the two nearest available years -- see :mod:pycensus.year_resolution).

'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 acs_-prefixed

GeoDataFrame

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

Raises:

Type Description
ValueError

If neither states nor aoi is given.