In [1]:
%matplotlib inline
import pandas as pd

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]:
titles = pd.read_csv('data/titles.csv')
titles.head()


Out[3]:
title year
0 A Lélek órása 1923
1 Aizaugusa gravi viegli krist 1986
2 Agliyorum 1988
3 0_1_0 2008
4 97 fung lau mung 1994

In [4]:
cast = pd.read_csv('data/cast.csv')
cast.head()


Out[4]:
title year name type character n
0 The Core 2003 Alejandro Abellan actor U.S.S. Soldier NaN
1 Il momento di uccidere 1968 Remo De Angelis actor Dago 9
2 Across the Divide 1921 Thomas Delmar actor Dago 4
3 Revan 2012 Diego James actor Dago NaN
4 Un homme marche dans la ville 1950 Fabien Loris actor Dago 12

How many movies are listed in the titles dataframe?


In [ ]:


In [ ]:

What are the earliest two films listed in the titles dataframe?


In [ ]:


In [ ]:

How many movies have the title "Hamlet"?


In [ ]:


In [ ]:

How many movies are titled "North by Northwest"?


In [ ]:


In [ ]:

When was the first movie titled "Hamlet" made?


In [ ]:


In [ ]:

List all of the "Treasure Island" movies from earliest to most recent.


In [ ]:


In [ ]:

How many movies were made in the year 1950?


In [ ]:


In [ ]:

How many movies were made in the year 1960?


In [ ]:


In [ ]:

How many movies were made from 1950 through 1959?


In [ ]:


In [ ]:

In what years has a movie titled "Batman" been released?


In [ ]:


In [ ]:

How many roles were there in the movie "Inception"?


In [ ]:


In [ ]:

How many roles in the movie "Inception" are NOT ranked by an "n" value?


In [ ]:


In [ ]:

But how many roles in the movie "Inception" did receive an "n" value?


In [ ]:


In [ ]:

Display the cast of "North by Northwest" in their correct "n"-value order, ignoring roles that did not earn a numeric "n" value.


In [ ]:


In [ ]:

Display the entire cast, in "n"-order, of the 1972 film "Sleuth".


In [ ]:


In [ ]:

Now display the entire cast, in "n"-order, of the 2007 version of "Sleuth".


In [ ]:


In [ ]:

How many roles were credited in the silent 1921 version of Hamlet?


In [ ]:


In [ ]:

How many roles were credited in Branagh’s 1996 Hamlet?


In [ ]:


In [ ]:

How many "Hamlet" roles have been listed in all film credits through history?


In [ ]:


In [ ]:

How many people have played an "Ophelia"?


In [ ]:


In [ ]:

How many people have played a role called "The Dude"?


In [ ]:


In [ ]:

How many people have played a role called "The Stranger"?


In [ ]:


In [ ]:

How many roles has Sidney Poitier played throughout his career?


In [ ]:


In [ ]:

How many roles has Judi Dench played?


In [ ]:


In [ ]:

List the supporting roles (having n=2) played by Cary Grant in the 1940s, in order by year.


In [ ]:


In [ ]:

List the leading roles that Cary Grant played in the 1940s in order by year.


In [ ]:


In [ ]:

How many roles were available for actors in the 1950s?


In [ ]:


In [ ]:

How many roles were available for actresses in the 1950s?


In [ ]:


In [ ]:

How many leading roles (n=1) were available from the beginning of film history through 1980?


In [ ]:


In [ ]:

How many non-leading roles were available through from the beginning of film history through 1980?


In [ ]:


In [ ]:

How many roles through 1980 were minor enough that they did not warrant a numeric "n" rank?


In [ ]:


In [ ]: