udit-k/TN2026_AC_Elections_Results
Tamil Nadu AC May 2026 — scraped CSV layout This repository distributes CSV extracts of published Tamil Nadu Assembly Constituency results (“TN”, state code S22) under the folders below. Paths are relative to the project root. Disclaimer and affiliation This project is not affiliated with or endorsed by the Election Commission of India (ECI). Published electoral totals remain official products of ECI (see NOTICE). Anything extracted here is provided as is… See the full description on the dataset page: https://huggingface.co/datasets/udit-k/TN2026_AC_Elections_Results.
Tamil Nadu AC May 2026 — scraped CSV layout
This repository distributes CSV extracts of published Tamil Nadu Assembly Constituency results (“TN”, state code S22) under the folders below. Paths are relative to the project root.
Disclaimer and affiliation
This project is not affiliated with or endorsed by the Election Commission of India (ECI). Published electoral totals remain official products of ECI (see `NOTICE`). Anything extracted here is provided as is, without warranty of correctness or completeness for any purpose—including journalism, litigation, or campaign messaging—and should be checked against results.eci.gov.in before reliance.
Scraping can stop working whenever URLs or HTML change; snapshot CSVs may drift unless regenerated.
License
Documentation in this repository (for example README.md) is released under the MIT License.
Bundled or regenerated CSV extracts derive from official publications as noted in `NOTICE`; cite both this repository (when publishing derivatives you built here) and the ECI portal as the originating governmental source.
Citation
Suggested wording:
Derived counts assembled using TN-2026-ECI-Scraping (paste your repository URL here), extracting tables published by the Election Commission of India at https://results.eci.gov.in/.
Replace with your GitHub URL / Zenodo DOI if you mint tags or archival deposits.
Methodology and known limitations
- Figures were extracted from ECI-published HTML; some non-Latin or malformed header/name rows were dropped during consolidation (English-focused sanity checks).
- Statewide CSV: trailing *`col_`** columns mirror stray glued markup fragments (“party wise state trends…”). Prefer documented snake_case columns for joins (see below).
- Party naming: abbreviations differ across vote-share exports vs wins CSV vs candidate exports—normalize explicitly before merges (
party_abbr, full strings). - Constituency label: wins CSV uses
NAME(const_no); statewise uses bare names plus `const_no`—always align joins on `const_no` (1–234).
Folder overview
TN_AC2026_general_statistics/
TN_AC2026_statewise_by_constituency.csv
Row grain: one constituency.
Additional columns (col_9, col_10, …) come from extra cells in the published HTML table (party-wise trend snippets, etc.). Prefer the snakecase columns above for analysis; treat trailing `col*` as optional / noisy.
TN_AC2026_constituency_no_to_name.csv
Row grain: one AC number.
This file is derived from the statewise CSV whenever that scrape succeeds.
TN_AC2026_vote_share_by_party.csv
Row grain: one party (state-wide vote share).
TN_AC2026_party_seat_totals.csv
Row grain: one party.
TN_AC2026_all_party_constituency_wins.csv
Row grain: one seat won (concatenation of all per-party win files).
Extracting `const_no` for joins: parse the trailing parenthetical, e.g. TIRUTTANI(3) → 3.
TN_AC2026_constituency_wins_by_party/
Files: TN_AC2026_constituency_wins_<ABBR>.csv (e.g. TN_AC2026_constituency_wins_ADMK.csv).
Same columns as `TN_AC2026_all_party_constituency_wins.csv`, but only rows for that party.
TN_AC2026_candidates_by_ac/
Files: TN_AC2026_ac_<NNN>_candidates.csv where <NNN> is zero-padded `const_no` (001 … 234).
Row grain: one candidate in that constituency.
How to join datasets
Canonical constituency key: const_no
Use `const_no` (integer 1–234) whenever possible:
- Statewise ↔ AC name map:
statewise["const_no"]=map_df["const_no"]. - Statewise ↔ per-AC candidates:
statewise["const_no"]=candidates["const_no"]. - Merged / per-party wins ↔ others: add a column by parsing
Constituency:
import pandas as pd
wins = pd.read_csv("TN_AC2026_general_statistics/TN_AC2026_all_party_constituency_wins.csv")
wins["const_no"] = wins["Constituency"].str.extract(r"\((\d+)\)$").astype(int)
names = pd.read_csv("TN_AC2026_general_statistics/TN_AC2026_constituency_no_to_name.csv")
wins_named = wins.merge(names, on="const_no", how="left")Constituency names differ by file
- Statewise / map: plain name (e.g.
TIRUTTANI). - Wins CSVs:
NAME(AC_NO)inConstituency.
Do not rely on string equality between those two; join on `const_no` (or parse wins as above).
Party identifiers differ by table
- Seat totals:
party_abbr, fullparty_name. - Vote share: short
Partycolumn — may not exactly equalparty_abbr; fuzzy matching or a manual alias map may be needed for strict merges. - Candidates: full party name text per candidate row.
Typical pattern: merge seat totals to wins on party_abbr, or on normalized party_name after stripping suffix noise.
Load all candidate files into one table
from pathlib import Path
paths = sorted(Path("TN_AC2026_candidates_by_ac").glob("TN_AC2026_ac_*_candidates.csv"))
cand_all = pd.concat([pd.read_csv(p) for p in paths], ignore_index=True)
state = pd.read_csv("TN_AC2026_general_statistics/TN_AC2026_statewise_by_constituency.csv")
combined = cand_all.merge(state, on="const_no", how="left", suffixes=("", "_statewise"))