pycensus.census.countries.chile.casen.loader¶
Loader for Chile's Casen SAE comunal poverty estimates, returning a common-schema GeoDataFrame.
Technical aspects
Mirrors :mod:pycensus.census.countries.chile.ine.loader's shape (parquet
cache via :mod:pycensus.cache, geometry from
:mod:pycensus.census.countries.chile.geography), but the underlying source
is a real bulk .xlsx download (see :mod:pycensus.census.countries.chile.casen.api)
rather than a per-region API query -- so _fetch_missing fetches the
(cached) national table once and filters to just the comunas in the
requested region, instead of making a per-region network call.
Only "comuna" is implemented -- Casen SAE only publishes comuna-
level estimates (region-level poverty is already directly estimable
from the Casen survey itself without SAE, and isn't republished in
this bulk file).
load(aoi=None, regions=None, level='comuna', year='latest', cache_dir=None, cache=True, data_dir=None)
¶
Load Chile Casen SAE comunal poverty data as a common-schema GeoDataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
Optional[GeoDataFrame]
|
Area of interest. Used to auto-detect |
None
|
regions
|
Optional[Union[str, List[str]]]
|
Region name(s)/code(s) to load. Derived from |
None
|
level
|
str
|
Must resolve to |
'comuna'
|
year
|
Union[int, str]
|
Vintage year, or |
'latest'
|
cache_dir
|
Optional[str]
|
Root of pyCensus' parquet cache. Defaults to
:func: |
None
|
cache
|
bool
|
If |
True
|
data_dir
|
Optional[str]
|
Base directory for the raw .xlsx cache. Defaults to
:data: |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with |
GeoDataFrame
|
prefixed column per logical column in |
GeoDataFrame
|
data: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |