code: def load_french_elections():
      """Voting data for the 2022 French elections, by region.
  
      The [original dataset](https://www.data.gouv.fr/fr/datasets/resultats-du-premier-tour-de-lelection-presidentielle-2022-par-commune-et-par-departement/#resources)
      has been transformed into a contingency matrix. The latter tallies the number of votes for the
      12 candidates across all 18 regions. The number of blank and abstentions are also recorded.
      More information about these regions, including a map, can be found
      [on Wikipedia](https://www.wikiwand.com/fr/Région_française).
  
      """
      dataset = pd.read_csv(
          DATASETS_DIR / "02-resultats-par-region.csv"
      )
      cont = dataset.pivot(
          index="reg_name", columns="cand_nom", values="cand_nb_voix"
      )
      cont["Abstention"] = dataset.groupby("reg_name")[
          "abstention_nb"
      ].min()
      cont["Blank"] = dataset.groupby("reg_name")["blancs_nb"].min()
      cont.columns = [c.title() for c in cont.columns]
      cont.index.name = "region"
      cont.columns.name = "candidate"
      return cont
  
file_path: prince/prince/datasets.py
imports: from __future__ import annotations
  import pathlib
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: load_french_elections() and returns: cont