pycensus.census.countries.chile.elections.loader¶
Gran Concepcion (11 comunas) election results.
Implemented¶
national: Presidential election, second round, 2025-12-14 (Servel preliminary results = 100% of mesas counted; official escrutinio differs by a few votes), one row per mesa with its voting place (local de votacion) and registered electors. Source:https://www.servel.cl/wp-content/uploads/2025/12/Datos_SegundaVotacion.zip(PRELIMINARES_PRESIDENTE_DE_LA_REPUBLICA_En_Chile.xlsx). total_votes = valid votes (Kast + Jara) + blank; null votes excluded; turnout = (valid + blank + null) / electors.
Geometry (important approximation)¶
Servel publishes NO polygons or coordinates for mesas / locales de votacion. Locales are geocoded with OSM Nominatim (name + comuna;
retries with simplified names; cached in <cache>/elections/raw/chile/locales_geocoded.json). The unit "polygon" of a geocoded local is
its Thiessen (Voronoi) cell clipped to its comuna; the votes of all mesas of that local go to that cell. Locales that cannot be
geocoded are pooled per comuna and spread over the comuna's cells proportionally to electors. Thus the H3/census values are a
catchment approximation (nearest-local), not true polling boundaries.
NOT implemented (not found as bulk open data)¶
state(Gobernador regional 2024, Biobio, 2024-10-27 / runoff 2024-11-24) andmunicipal(Alcalde 2024-10-27): Servel only serves them through the SPA elecciones.servel.cl / eleccionesgore.servel.cl (per-mesa pages and acta images) and the old servel.cl pages that held the files return 404; no CSV/XLSX bulk download was located.
load_all(scope='national', census_geometry=None, aoi=None, worldpop_path=None, cache_dir=None, geocode=True)
¶
{"local", "h3", "manzana", "zona"} frames. aoi: GeoDataFrame with a municipality column (comuna polygons).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
str
|
Only |
'national'
|
census_geometry
|
Optional[Dict[str, GeoDataFrame]]
|
|
None
|
aoi
|
Optional[GeoDataFrame]
|
Comuna polygons ( |
None
|
worldpop_path
|
Optional[str]
|
Explicit WorldPop raster. |
None
|
cache_dir
|
Optional[str]
|
Cache folder; |
None
|
geocode
|
bool
|
Geocode the polling places. |
True
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
For another scope. |
load(scope='national', level='manzana', **kw)
¶
Example: load("national", level="manzana", aoi=gdf); levels manzana, zona, h3, local.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scope
|
str
|
Only |
'national'
|
level
|
str
|
|
'manzana'
|
**kw
|
Passed to :func: |
{}
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
The frame of that level. |