A blog about nothing
(not that there’s anything wrong with that)
In my previous post, we examined NY Magazine’s vulture.com rankings of Seinfeld episodes. By assigning each episode a points based on their rankings (I arbitrarily made a linear point scale from worst to best - unless anyone reading is a stats person and wants to weigh in…), we found that Season 5 was the runaway winner. An average Season 5 episode would’ve ranked ~52nd, meaning its episodes were, on average, in the the top 1/3 of the whole show. I thought it would be fun to continue this thought experiment.
Who are the best writers in the history of the show? Solving this would take two wi-fi enabled flights back and forth to Tampa and a couple hours when you wake up earlier than your wife even though you’re on vacation and you can’t sleep in.
In the previous exercise, we grabbed our rankings from Vulture’s website using a simple jQuery statement, and then iterated through the strings to get the info we needed to make our rankings. Now, we needed to get each episode’s writer and link them up to rankings to know who is truly master of the domain.
I’ll show some code, but if you’re bored or uninterested, just skip to the bottom for the summary.
Writer? We’re talking about a sitcom
Luckily for us, there is a free API called The Open Movie Database that gives us most of the same information found on IMDB. I may do something with IMDB ratings at some point, but to be honest, they are mostly useless and would probably yield very little information of interest. Anyhow, OMDb has a very simple API as far as TV series are concerned. There are 2 methods I used. The first is http://www.omdbapi.com/?t={show}&Season={season#}
. A request for Seinfeld’s first season http://www.omdbapi.com/Season=1
returns a nice JSON object:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
So now, we simply make this call for each season of the show, incrementing up the season number until there is no response. Along the way, we collect the imdbID
’s for our second call. Then, we use the i={imdbID}
API method for each episode we collected. A sample response would look like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Now, we just have to parse the Writer
attribute, split on the commas and filter out any of the writer credits we want to ignore (e.g. “created by”, “story by”, “story editor”, etc). We are just interested in the main billed writer for this experiment.
It’s going in the vault
So, now that it looks like I’m going to be making upwards of 180 or so API calls, I’m going to want to persist this data so I don’t have to make all these calls over and over again. We’ll make a few tables: Episodes, Seasons, Writers, and EpisodeWriters (a join table since an episode can have multiple writers.) Join them up and we’re ready to go.
Working in a Ruby ActiveRecord enabled environment makes this all really easy. Maybe I’ll do this all again in Node one day..
Here’s the Writer
class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
He named names!
For arguments, sake we’ll limit our sample to those writers who contributed more than 5 episodes over the course of the series. This gives us a total of 11 writers, sorted by average episode rank (writing duos Jeff Schaffer / Alec Berg and Tom Gammill / Max Pross are listed together. Jerry and Larry, while collaborators on a lot of episodes, are listed separately because of Larry’s significant solo career). Ready?
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Very interesting! Larry David is by far the biggest (billed) individual contributor to the show, but his average episode ranks towards the bottom. By contrast, Jeff Schaffer and Alec Berg, who later went on to create the league have both the second most total points (behind Larry) and the highest average. Here’s a list of their episodes and rankings:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
10 of 12 episodes are considered by Vulture above average, 9 of 12 in the top 1/3, 3 in the Top 20, and only 1 in the bottom 1/3 of episodes. In fact, an entire season of Schaffer/Berg episodes would’ve ranked higher than Season 5, the overall top ranked season.
Larry, on the other hand, has the dubious distinction of having written both Vulture’s top and bottom ranked episode. Of course, calling “The Finale” the worst Seinfeld episode is a stunt. It’s barely a Seinfeld episode and outside of the music and cast is nothing like the rest of the series. So it is at this point, perhaps, the ranking system breaks down. “The Contest” is not only the most acclaimed Seinfeld episodes, it is roundly considered one of the greatest scripted half hours in television history. In fact, it’s critical success is partly what lead to the explosion in Seinfeld’s popularity. Without it, there might not have been five more seasons. Is it worth only 1 more point in the rankings than the next best episode on the list (“The Subway”)? I can’t say for sure.
I should, however, note that while Larry and Jerry’s rankings are somewhat low this is skewed data. It is said that the pair (through the end of Season 7, and later Jerry alone) had final say on all scripts and did the last pass of every episode. They tended to take billing as an episode’s writer less and less throughout the series and were more likely the billed writers in the early, low ranking seasons. Whether this is reflective of their contributions to the show’s writing I cannot say, but thought it worth mentioning.
Directors
We can do a similar analysis using virtually the same code, just swapping out Writer
for Director
because object oriented metaprogramming is cool like that.
We’ll just check in on the two directors who directed the overwhelming majority of the show’s episodes: Tom Cherones (Seasons 1-5) and Andy Ackerman (6-9). My gut told me that Ackerman would have better stats, which he did, though slightly.
1 2 3 4 |
|