In [1]:
%matplotlib inline
import pandas as pd
import seaborn as sbn
sbn.set()
In [2]:
from IPython.core.display import HTML
css = open('style-table.css').read() + open('style-notebook.css').read()
HTML('<style>{}</style>'.format(css))
Out[2]:
In [3]:
cast = pd.DataFrame.from_csv('data/cast.csv', index_col=None)
cast.head()
Out[3]:
In [4]:
release_dates = pd.DataFrame.from_csv('data/release_dates.csv', index_col=None,
parse_dates=['date'], infer_datetime_format=True)
release_dates.head()
Out[4]:
In [ ]:
In [7]:
stNick = release_dates[release_dates.title.str.contains('Christmas')]
stNick.date.dt.month.value_counts().sort_index().plot(kind='bar')
Out[7]:
In [ ]:
In [8]:
frodoBaggins = release_dates[release_dates.title.str.startswith('The Hobbit')]
frodoBaggins.date.dt.month.value_counts().sort_index().plot(kind='bar')
Out[8]:
In [ ]:
In [10]:
ronJeremy = release_dates[release_dates.title.str.contains('Romance')]
ronJeremy.date.dt.dayofweek.value_counts().sort_index().plot(kind='bar')
Out[10]:
In [ ]:
In [11]:
jamesBond = release_dates[release_dates.title.str.contains('Action')]
jamesBond.date.dt.dayofweek.value_counts().sort_index().plot(kind='bar')
Out[11]:
In [ ]:
In [26]:
judiDench = pd.merge(cast[(cast.name=='Judi Dench')],release_dates[release_dates.country=='USA'])
In [27]:
judiDench[judiDench.year//10 == 199]
Out[27]:
In [30]:
judiDench.date.dt.month.value_counts().sort_index()
Out[30]:
In [ ]:
In [31]:
tommyC =pd.merge(cast[(cast.name=='Tom Cruise')],release_dates[release_dates.country=='USA'])
In [32]:
tommyC.date.dt.month.value_counts().sort_index()
Out[32]:
In [ ]: