By Candidate

Each CSV file contains one row for each candidate. There is one file for each election since 1867 plus one file that contains all of the candidates since 1867. Each CSV file contains the following columns.

  1. election_id: A sequence number for the election: 1 for the first one in 1867, 2 for the second one in 1872, etc.
  2. election_date: The date the bulk of the election was held. Some early elections were held on different days in different regions of the country.
  3. prov_code: A code such as “NB” or “ON” to indicate the candidate’s province.
  4. ed_id: A code for the electoral district (riding). In recent elections, it’s the same code that Elections Canada uses; in older elections it’s simply a sequence number.
  5. ed_name: The name of the electoral district (riding).
  6. cand_id: A unique number assigned to each candidate. I’d love to have the same number assigned to each of the five times Harold Albrecht ran, for example. But the hurdles of merging “Harold Albrecht” with “Harold Glenn Albrecht” or the 3 times Julian Ichim ran in Kitchener-Waterloo with the one time he ran in Kitchener-Centre are more than I can tackle right now. So each candidate in each election has an id number.
  7. cand_name: The name of the candidate.
  8. cand_raw_party_name: The candidate’s party name as recorded in the raw data.
  9. party_id: An id number for the for the “cleaned” parties. Please see the section on “cleaning party names”, below. This id can be looked up in csv_other/party_summary.csv to find the party name and a flag for whether it is “mainline” or not.
  10. party_name: The “cleaned” party name. See below.
  11. party_short_name: A shortened version of the party name; hopefully suitable for column names.
  12. mainstream: A boolean value; true if the party ever attained 5% or more of the popular vote and false otherwise.
  13. votes: The number of votes the candidate earned (unless s/he was acclaimed).
  14. acclaimed: In early elections some candidates did not have opposition and were acclaimed. In those cases, votes were not held and so the votes column is blank/null. This column is true if the candidate was acclaimed and false otherwise.
  15. place: The rank of this candidate within their electoral district with 1 being the candidate with the most votes.

Note that the last file has data for all candidates.