realize where the result was coming from. Add polls
This commit is contained in:
parent
1d6ec55612
commit
e6374cbc82
19
README.md
Normal file
19
README.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
Electoral votes/election
|
||||
|
||||
Year | Republican electoral college votes
|
||||
2000 | 271
|
||||
2004 | 286
|
||||
2008 | 173
|
||||
2012 | 206
|
||||
2016 | 304
|
||||
2020 | 232
|
||||
|
||||
Year | Democrat electoral college votes
|
||||
2000 | 266
|
||||
2004 | 251
|
||||
2008 | 365
|
||||
2012 | 332
|
||||
2016 | 227
|
||||
2020 | 232
|
||||
|
||||
Ok, so because Obama really trounced the opposition, it won by more than the Republicans won, which means that the baserates approach didn't really work.
|
7025
data/polls/president_polls.csv
Normal file
7025
data/polls/president_polls.csv
Normal file
File diff suppressed because it is too large
Load Diff
2525
data/polls/president_polls_state.csv
Normal file
2525
data/polls/president_polls_state.csv
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
State,Winning Party
|
||||
State,Party
|
||||
Alabama,R
|
||||
Alaska,R
|
||||
Arizona,R
|
||||
|
|
|
|
@ -1,3 +1,4 @@
|
|||
State,Party
|
||||
Alabama,R
|
||||
Alaska,R
|
||||
Arizona,D
|
||||
|
|
|
|
@ -1,3 +1,8 @@
|
|||
https://www.archives.gov/electoral-college/2000
|
||||
https://www.archives.gov/electoral-college/2004
|
||||
https://www.archives.gov/electoral-college/2008
|
||||
https://www.archives.gov/electoral-college/2012
|
||||
https://www.archives.gov/electoral-college/2016
|
||||
https://www.archives.gov/electoral-college/2020
|
||||
https://www.archives.gov/electoral-college/[year]
|
||||
|
||||
|
|
3
main.go
3
main.go
|
@ -31,7 +31,8 @@ func readStates() ([]State, error) {
|
|||
var states map[string]State = make(map[string]State)
|
||||
|
||||
/* Electoral college votes for the 2024 election*/
|
||||
votes_file, err := os.Open("data/electoral-college-votes-2010-census.csv")
|
||||
votes_file, err := os.Open("data/electoral-college-votes.csv")
|
||||
// votes_file, err := os.Open("data/electoral-college-votes-2010-census.csv")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error opening the votes file: %v", err)
|
||||
}
|
||||
|
|
6
makefile
Normal file
6
makefile
Normal file
|
@ -0,0 +1,6 @@
|
|||
polls:
|
||||
mkdir -p data/polls
|
||||
# cd data/polls && wget https://projects.fivethirtyeight.com/polls/data/president_polls.csv
|
||||
cat data/polls/president_polls.csv | awk -F, 'NR==1 {print; next} $$13 != ""' > data/polls/president_polls_state.csv
|
||||
# cd data/polls && awk -F, 'NR == 1 || $13 != ""' president_polls.csv > president_polls_state.csv
|
||||
|
Loading…
Reference in New Issue
Block a user