Skip to content

pycensus.census.countries.andorra.elections.loader

Andorra election results at parish (comu) level: Consell General 2 April 2023 (national list) and Comunals 17 Dec 2023.

Sources (verified live 2026-10-25), Govern d'Andorra election site: Comunals 2023: https://www.eleccions.ad/resultats (HTML, one block per parish: electors, escrutats, valids, blancs, nuls, votes per list). Parsed live (raw page cached to <data_dir>/raw/elections/eleccions_ad_resultats.html; the site shows only the latest election, so keep the cache). Consell General 2023: https://www.eleccions.ad/documentacio/anteriors/EG_2023.pdf (image-only PDF, no text layer, no machine-readable file published). The "Escrutini de la circumscripcio nacional per parroquia" tables were transcribed by hand (visual read) into _EG2023 below; all 7 parish rows add up to the published national totals (19,172 valid votes, 537 blank, 341 null, 20,050 cast). Only the national list is used (its votes are broken down by parish; the 14 parish-list seats are elected on local lists and are not comparable between parishes). Native resolution: parish (7). Andorra has no state/regional parliament, so scope state does not exist. Andorra publishes no polling-station results. Geometry: parish polygons, andorra.geography.load_boundaries('parish') (GEOID AD-01..AD-07). H3 res 8 is AREA-weighted over parish polygons, i.e. every cell of a parish gets the parish's vote shares (no sub-parish information exists); counts are split by area. Blocs: schema/elections_blocs.json. Comunals lists are local coalitions that mix parties; almost all are marked uncertain.

norm(s)

Upper-case ASCII party name with the long SDP coalition name shortened (the key of the blocs file).

Parameters:

Name Type Description Default
s str

Party name.

required

Returns:

Type Description
str

The normalised name.

load_election(scope, year, level='parish', data_dir=None, min_share=0.03)

scope 'national' (Consell General 2023) or 'municipal' (Comunals 2023). level: 'parish' (GEOID AD-0X) or 'h3' (h3_cell, res 8).

Parameters:

Name Type Description Default
scope str

"national", "state" or "municipal".

required
year int

Election year (2023).

required
level str

"parish" or "h3".

'parish'
data_dir Optional[str]

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

None
min_share float

Parties above this share get their own columns.

0.03

Returns:

Type Description
DataFrame

The election frame.

load_consell_general_2023(level='parish', data_dir=None)

Consell General election 2023 (see :func:load_election).

Parameters:

Name Type Description Default
level

"parish" or "h3".

'parish'
data_dir

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

None

Returns:

Type Description

The election frame.

load_comunals_2023(level='parish', data_dir=None)

Comunal (parish council) elections 2023 (see :func:load_election).

Parameters:

Name Type Description Default
level

"parish" or "h3".

'parish'
data_dir

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

None

Returns:

Type Description

The election frame.