Skip to content

pycensus.census.countries.spain.serpavi

SERPAVI (Sistema Estatal de Referencia del Precio del Alquiler de Vivienda, Ministerio de Vivienda) loader.

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

Return SERPAVI columns for level ('section'|'district'|'municipality'|'province'), optionally restricted to 2-digit provinces and years. Adds serpavi_rent_m2_latest and serpavi_rent_m2_latest_year.

Parameters:

Name Type Description Default
provinces Optional[Iterable[str]]

2-digit province codes.

None
level str

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

'section'
data_dir Optional[str]

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

None
years Optional[Iterable[int]]

Years kept; None = all.

None

Returns:

Type Description
DataFrame

One row per unit.

municipality_crosswalk(data_dir=None)

Province name + municipality name -> 5-digit INE code (from the SERPAVI 'Municipios' sheet), used to join name-only sources.

Parameters:

Name Type Description Default
data_dir Optional[str]

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

None

Returns:

Type Description
DataFrame

CPRO, NPRO, CUMUN, NMUN.