In [3]:
%matplotlib inline
import pandas as pd
import seaborn as sbn
sbn.set()
In [4]:
from IPython.core.display import HTML
css = open('style-table.css').read() + open('style-notebook.css').read()
HTML('<style>{}</style>'.format(css))
Out[4]:
In [5]:
titles = pd.DataFrame.from_csv('data/titles.csv', index_col=None)
titles.head()
Out[5]:
In [6]:
cast = pd.DataFrame.from_csv('data/cast.csv', index_col=None)
cast.head()
Out[6]:
In [ ]:
In [10]:
titles['decade'] = titles.year // 10 * 10
titles.groupby('decade').size().plot(kind='bar')
Out[10]:
In [ ]:
In [11]:
titles[titles.title=='Hamlet'].groupby('decade').size().sort_index().plot(kind='bar')
Out[11]:
In [ ]:
In [14]:
cast[(cast.year//10==195)&(cast.n==1)].groupby(['year','type']).type.value_counts()
Out[14]:
In [ ]:
In [41]:
cast[(cast.year//10==195)&(cast.n<=5)].groupby(['n','type']).type.value_counts()
Out[41]:
In [ ]:
In [23]:
cast[cast.title.str.contains('Pink Panther')].groupby('year').size()
Out[23]:
In [ ]:
In [39]:
cast[cast.name=='Frank Oz'].groupby(['title','year']).size()>1
Out[39]:
In [ ]:
In [ ]:
In [ ]:
In [63]:
cast[cast.name=='Frank Oz'].groupby('character').size()>2
Out[63]:
In [ ]: