Skip to content

pycensus.census.countries.usa.lodes_rac.loader

Loader for LODES RAC (Residence Area Characteristics) job counts.

Technical aspects

Reads as much as possible from pyCensus' parquet cache (:mod:pycensus.cache, shared with ACS/DHC for the same level/region), fetching pre-aggregated block-level LODES data with pygris.data.get_lodes only when a requested column is missing. LODES ships one flat file per state/type/year (no per-variable selection), so a single missing column still triggers a full state fetch -- but that fetch only happens once per level/region/type, ever, thanks to the cache. agg_level asks pygris to pre-sum blocks up to the requested level before the data even reaches this loader.

Source

https://lehd.ces.census.gov/data/lodes/LODES8/LODESTechDoc8.3.pdf

load_rac(aoi=None, states=None, level='blockgroup', year='latest', cache_dir=None, cache=True)

Load LODES Residence Area Characteristics (jobs held by residents) data.

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 to pre-aggregate LODES blocks to.

'blockgroup'
year Union[int, str]

Vintage year, or "latest".

'latest'
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

GeoDataFrame

lodes_rac_-prefixed column per logical column in

GeoDataFrame

data:pycensus.usa.lodes_rac.schema.SCHEMA.