States Who Gained and Lost Electoral College Votes in the Last 30 Years

While working on a data visualization and web app project about presidential elections, I noticed that several states have either gained or lost votes (based on population) in the Electoral College with each census. Some states stayed the same throughout none of them gained-then-lost nor lost-then-gained.

States That Gained Votes Twice

  • Arizona
  • Florida
  • Georgia
  • Nevada
  • Texas

States That Lost Votes Twice

  • Illinois
  • Michigan
  • New York
  • Ohio
  • Pennsylvania

States That Stayed the Same

  • Alabama
  • Alaska
  • Arkansas
  • Hawaii
  • Idaho
  • Kansas
  • Kentucky
  • Maine
  • Maryland
  • Minnesota
  • Montana
  • Nebraska
  • New Hampshire
  • New Mexico
  • North Dakota
  • Oregon
  • Rhode Island
  • South Dakota
  • Tennessee
  • Vermont
  • Virginia
  • West Virginia
  • Wyoming

Others

  • California, Colorado, North Carolina each -1 vote in 2004
  • Connecticut, Indiana, Mississippi, Oklahoma, Wisconsin each -1 vote in 2004
  • South Carolina, Utah, Washington each +1 vote in 2012
  • Iowa, Louisiana, Massachusetts, Missouri, New Jersey each +1 vote in 2012

ecExcel

Advertisements
Posted in myProjects, PrezPlayPro | Tagged | Leave a comment

My Second Schema Revising

“Hmm …” he says, realizing he’ll want data viz for multiple elections and many candidates run in multiple elections … and sometimes they change parties …

  • Where should the year go?
  • Where the party at?

Oh, man … the number of Electoral College votes a state gets can change (based on population) as well …

And, aw, crap! Two states (Nebraska and Maine) don’t follow the stupid “winner take all” rule. Normally, I’d like that but it’s a pain in my butt now.

schemaRevised

Later changed “popVotes” table name to “results.” Considered having different results tables for different years but I think having affiliations and results structured the same will help me keep my code straight in my head.

Note how New York and Michigan lose votes with each census while Florida and Texas gain them (check out other examples in the screenshot below). The number of votes a state gets changes every ten years with the census so my electoralCollege table has columns for each first election of the decade so the following election years are grouped together.

  • 1992, 1996, 2000
  • 2004, 2008
  • 2012, 2016, 2020

Here’s what I made in Excel that I’ll save as a CSV.

ecExcel

It’s irritating how many different websites I have to visit to get these numbers, election results, etc.

News media get these results in real time so somebody has this information handy somewhere. Ugh.

It’s also irritating that, in an effort to find a faster way to convert the (sometimes PDF to) Excel to something usable in CSV I spend more time than if I just tediously copied and pasted. I do the same thing with my code. I think there must be a more elegant, faster way to do stuff when, nope, it’s only code, and it’s more simple and easy than I’m making it. Having said that, I’m unsure if this is the best way for this and other tables in this database to be organized, but here’s how I’m using the data for party affiliations.

affiliationsExcel

In the original PDF from the Federal Election Commission (FEC), it looked like this:

Evan McMullin (CCS, IDP, IND, BFA, NP, UN)

I haven’t thought too much yet about how I’ll query for party affiliation and morph that into my broad-stroke “socialist” and “conservative” big tents so I tried to make it as simple and malleable as possible. I’m very anxious to get started — this concept has been wanted to be born for a long, long time — so I’m allowing myself to rush a bit. I don’t mind having to fix it later if I must — it’ll be a fun learning experience (I hope).

It’s late in the day and I’m not sure if this is the best schema because I’m rushing a bit so I’ll need to review this later but this is what I’m going with to start.

electionDB2

Yep. Some of those commas shouldn’t be there. Noticed when I tried pasting into my Terminal.

Posted in Databases, Elections, myProjects, MySQL | Tagged | Leave a comment

My Second Schema

Last time I really worked with results from the 2016 Presidential Election was recorded for posterity in a post from December 2016. Politico never did bother to finish entering complete election results so I’ve been waiting for the FEC to get around to releasing them officially. They finally have. Not in a format you can download or even in an Excel spreadsheet, mind you — of course not — but at least Acrobat Pro let me save the PDF as an Excel file that wasn’t too painful to clean up. Now to export that in a way that won’t be too painful to import into MySQL.

UPDATE Many Minutes Later: Wow. Who would have thunk designing a “simple” database for this would take this much thought?

Here’s what I’ll probably go with:

Originally, there were id columns for the parties and states tables. I may put those back but I like the human-readability of using party abbreviations and state abbreviations.

Posted in Data Visualization, MySQL | Leave a comment

PHP Beach Party

The post title was going to be “Swimming in PHP” but I’m also just relaxing on PHP Beach. And dancing on PHP Beach with Annette Funicello, Yvonne Craig and Bettie Page who all take turns praising my mad PHP skillz.

Totally real pictures of me with Bettie, Yvonne, and Annette.

Who knew this Spotify thing would be what I really needed to make my PHP learning really kick it up to the next level? Not me.

Posted in myLearning, myProgress, myProjects | Leave a comment

Everything Wrong (and Right) with eLearning in 2017

The night before last, my wife and I were talking about the radical difference in available opportunities between, say, 1990 (when I got out of the Air Force) and now.

In 1990, laptops and computers were expensive. Even if you had a laptop, there was no WiFi. Even if there were WiFi, what would you connect to? College — even community college (tuition plus books) — was expensive. Classes and majors for “non-traditional” students who worked during the day were non-existent. The only place you could access a computer if you couldn’t afford one of your own was the library (free but crappy hours unless you lived in Ann Arbor, MI) or you could rent one any time 24/7 at Kinko’s. But, again, what were you going to do with that computer to learn?

Everything Right with the State of eLearning in 2017

In the last several years:

  • laptops have plummeted in price
    • Free WiFi is everywhere
      • ¬†YouTube tutorials (free) by experts ranging from grade-schoolers to experienced adults
      • Khan Academy
      • Codecademy
      • FreeCodeCamp
      • StackExchange
      • Reddit
      • Udacity
      • Udemy
      • EdX
      • Countless personal sites (free and paid)
      • Countless org/corp sites (free and paid)
      • Freaking Meetups!
      • and so on …
  • The public library
    • Overdrive

Education now is like porn — why would you ever pay for it when there’s so much quality product out there for free?

I wish these opportunities had existed from 1990-2000. My life would be very different.

Sadly, for many — myself included — another, extremely ironic, difference is we had all the time in the world back then to study … but no way to study*. Now, there’s so little precious time what with full-time job, wife, and children. Some people have multiple jobs.

*And, like I said, nothing really to study. And most of what I’m studying now didn’t even exist (or barely existed) in 2000. I didn’t know what to do with what I did have access to.

But, thanks to everything listed above, we can at least make every precious moment count.

Everything Wrong with eLearning in 2017

The idea for this post started off pretty negative but I changed it to begin with a positive (above). It was actually born as “everything wrong with Instructional Design in 2017” and inspired by …

All the culprits responsible for crimes against humanity (Powerpoint, Articulate, and iSpring) in one place. Well, Captivate isn’t there … like the Joker, it seems to be off somewhere else … watching the world burn. On my list of evil organizations, Articulate is above ISIS and the Nazis.

Posted in elearning, Instructional Design, Learning | Leave a comment

A Few Key Posts

For those who feel 2+ years of a blog qualifies as TL;DR.

Posted in Feelings, myExperience | Leave a comment

And Still World’s Greatest Developer

Look at this.

firstPopArtistBatch.png

Am I not the world’s greatest programmer?

Posted in myProjects | Leave a comment