In [68]:
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
from mpltools import style
from mpltools import layout
style.use('ggplot')
In [3]:
from IPython.core.display import HTML
css = open('style-table.css').read() + open('style-notebook.css').read()
HTML('<style>{}</style>'.format(css))
Out[3]:
In [4]:
titles = pd.DataFrame.from_csv('data/titles.csv', index_col=None)
titles.head()
Out[4]:
In [5]:
cast = pd.DataFrame.from_csv('data/cast.csv', index_col=None)
cast.head()
Out[5]:
In [17]:
titles['title'].value_counts().head()
Out[17]:
In [12]:
titles['title'][titles.title == 'xXx']
Out[12]:
In [63]:
moviesOf1930s = titles[(titles.year >= 1930) & (titles.year < 1940)]
moviesOf1930s.year.value_counts().sort_index().plot()
Out[63]:
In [ ]:
In [78]:
t = titles
t.groupby(t.year // 10 * 10).size().plot(kind='bar')
del t
In [77]:
hFilms = titles[titles.title == 'Hamlet']
hFilms.groupby(hFilms.year // 10 * 10).size().plot(kind='bar')
del hFilms
In [81]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [82]:
c = cast
c = c[c.name == "George Clooney"]
c.groupby(['year']).size().plot(kind='hist')
del c
In [ ]: