Skip to content

pycensus.census.countries.spain.adrh.loader

Loader for INE's Atlas de Distribución de Renta de los Hogares (ADRH, operation 353): per census section / district / municipality income (mean net/gross per person and household, per consumption unit), income sources, Gini and P80/P20, relative-poverty shares and demographic indicators (mean age, <18 and 65+ shares, household size, single-person households, nationality).

Technical aspects

INE publishes one table per province and indicator family (CSV bulk files at https://www.ine.es/jaxiT3/files/t/es/csv_bd/<table id>.csv?nocab=1). The table ids of a province are found by reading the first data row of each table of operation 353 (servicios.ine.es/wstempus lists them) and cached in <data_dir>/raw/adrh/tables.json. Values are thousands of euros with a decimal point (20.935 = 20,935 EUR) -> multiplied by 1000. The latest period of each table is used.

load_attributes returns a plain DataFrame (GEOID = 10-digit section code or 5-digit municipality code) with global-schema names bare (meanHouseholdIncome, under18Population, over65Population, households, povertyPopulation) and the other indicators prefixed ine_; geometry comes from the caller (pycensus.census.countries.spain.ine).

load_attributes(provinces, level='section', data_dir=None)

ADRH indicators of level ('section' / 'district' / 'municipality') for the 2-digit provinces.

Parameters:

Name Type Description Default
provinces Iterable[str]

2-digit province codes.

required
level str

"section", "district" or "municipality".

'section'
data_dir Optional[str]

Folder of the raw downloads; None = the pycensus cache.

None

Returns:

Type Description
DataFrame

One row per unit (GEOID).