openelections / openelections-data-wi

Pre-processed election results for Wisconsin elections
9 stars 9 forks source link

Handle 2000-11-07 input files with single-line headers #36

Closed davipo closed 6 years ago

davipo commented 6 years ago

We've seen single-line headers in just one election so far, id 1845 (results in 20001107wigeneral__ward.csv). Two of the six input files have a single-line header: 001107_US_SEN_SORT.xls 001107_PRES_SORT.xls The rest have the usual two-line headers.

In the single-line headers, the party name is appended to the name of each candidate. To separate these, we can look for known party names. (Splitting off the last word does not work for two-word parties, such as "Wisconsin Greens".)

davipo commented 6 years ago

I wrote a function split_candidate_party() to separate candidate from party. This appears to be working in davipo/openelections-data-wi, but needs testing before we close this issue.

davipo commented 6 years ago

I added three tests to check 20001107wigeneral__ward.csv, they pass. Looks like this is resolved.