Created
February 25, 2013 02:27
-
-
Save ezod/5026977 to your computer and use it in GitHub Desktop.
Quantifying the 21st-century trend of film sequels, remakes, and franchise reboots over the top 10 grossing films each year since 2000.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Quantifying the 21st-century trend of film sequels, remakes, and franchise | |
# reboots over the top 10 grossing films each year since 2000. | |
import numpy | |
from scipy import stats | |
y = range(2000, 2013) | |
# The 'installments' dict contains the number of the installment in a series | |
# for each of the top 10 grossing films for each year since 2000. Remakes are | |
# considered first in the series, and franchise reboots are counted from one. | |
# Special Notes | |
# - Star Wars Episodes II and III are counted as fifth and sixth, respectively. | |
# - The three Bond films are outliers, but fair is fair. | |
# Source: http://www.boxofficemojo.com/yearly | |
installments = {} | |
installments[2000] = [1, 1, 2, 1, 1, 1, 1, 1, 1, 1] | |
installments[2001] = [1, 1, 1, 1, 2, 2, 1, 1, 3, 1] | |
installments[2002] = [1, 2, 5, 2, 1, 1, 3, 2, 1, 1] | |
installments[2003] = [3, 1, 1, 2, 1, 2, 1, 3, 3, 1] | |
installments[2004] = [2, 2, 1, 2, 1, 3, 1, 2, 1, 1] | |
installments[2005] = [6, 1, 4, 1, 1, 1, 1, 1, 1, 1] | |
installments[2006] = [2, 1, 1, 3, 1, 1, 1, 2, 21, 1] | |
installments[2007] = [3, 3, 1, 3, 5, 1, 3, 2, 1, 1] | |
installments[2008] = [2, 1, 4, 1, 1, 1, 1, 2, 22, 1] | |
installments[2009] = [1, 2, 6, 2, 1, 1, 1, 1, 2, 1] | |
installments[2010] = [3, 1, 2, 3, 7, 1, 1, 4, 1, 1] | |
installments[2011] = [8, 3, 4, 2, 4, 5, 4, 2, 2, 1] | |
installments[2012] = [1, 3, 1, 23, 1, 5, 1, 1, 1, 3] | |
original_means = [numpy.mean(installments[year]) for year in y] | |
o_slope, o_intercept, o_r_value, o_p_value, o_std_err = \ | |
stats.linregress(y, original_means) | |
o = lambda year: o_slope * year + o_intercept | |
# If the film is a remake, the number of previous versions of that film and any | |
# sequels is added to its installment number. If the film is part of a franchise | |
# reboot, the total number of previous films is added. | |
# Special Notes | |
# - Neither of the other two 2005 War of the Worlds films are included. | |
# - The Batman film serials of 1943 and 1949 are not included. | |
# - Previous adaptations of Sherlock Holmes are all counted as one. | |
# - Previous adaptations of Alice in Wonderland are all counted as one. | |
installments[2000][0] += 1 # How the Grinch Stole Christmas! (1966) | |
installments[2001][1] += 1 # Ralph Bakshi's Lord of the Rings (1978) | |
installments[2001][7] += 1 # Ocean's 11 (1960) | |
installments[2001][9] += 5 # Planet of the Apes series (1968 - 1973) | |
installments[2002][0] += 1 # Spider-Man (1977) | |
installments[2002][1] += 1 # Ralph Bakshi's Lord of the Rings (1978) | |
installments[2003][0] += 1 # Ralph Bakshi's Lord of the Rings (1978) | |
installments[2003][9] += 1 # Cheaper by the Dozen (1950) | |
installments[2004][1] += 1 # Spider-Man (1977) | |
installments[2005][3] += 1 # The War of the Worlds (1953) | |
installments[2005][4] += 6 # various King Kong films (1933 - 1986) | |
installments[2005][6] += 1 # Willy Wonka & the Chocolate Factory (1971) | |
installments[2005][7] += 5 # various Batman films (1966 - 1997) | |
installments[2006][5] += 4 # Superman series (1978-1987) | |
installments[2007][0] += 1 # Spider-Man (1977) | |
installments[2007][2] += 1 # The Transformers: The Movie (1986) | |
installments[2008][0] += 5 # various Batman films (1966 - 1997) | |
installments[2009][1] += 1 # The Transformers: The Movie (1986) | |
installments[2009][6] += 10 # Star Trek series (1979 - 2002) | |
installments[2009][9] += 1 # various Sherlock Holmes adaptations | |
installments[2010][1] += 1 # various Alice in Wonderland adaptations | |
installments[2011][1] += 1 # The Transformers: The Movie (1986) | |
installments[2011][8] += 1 # various Sherlock Holmes adaptations | |
installments[2012][6] += 4 # Spider-Man (1977), Raimi series (2002 - 2007) | |
enhanced_means = [numpy.mean(installments[year]) for year in y] | |
e_slope, e_intercept, e_r_value, e_p_value, e_std_err = \ | |
stats.linregress(y, enhanced_means) | |
e = lambda year: e_slope * year + e_intercept | |
if __name__ == '__main__': | |
import matplotlib.pyplot as plt | |
plt.scatter(y, original_means, color='k') | |
po, = plt.plot([y[0], y[-1]], [o(y[0]), o(y[-1])], color='k') | |
plt.scatter(y, enhanced_means, color='b') | |
pe, = plt.plot([y[0], y[-1]], [e(y[0]), e(y[-1])], color='b') | |
plt.legend([po, pe], ['Direct', 'Indirect (Remakes & Reboots)']) | |
plt.title('Average Series Installment of Top 10 Grossing Films by Year') | |
plt.xlabel('Year') | |
plt.ylabel('Average Installment') | |
plt.axis((y[0], y[-1], 1, 5)) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment