INST326 Homework 4

20170620, Movies, the IMDb, Analysis

The assignments below comprise your fourth homework assignment. Provide the implementations requested.

You will be graded on the following rubric:

  • Documentation: Your code should be sufficiently documented so as to demonstrate you have an understanding of what your code is doing. This point is especially important if you are citing code from the Internet.
  • Execution: Your code should at least execute. If your code does not run, you will get no points for this criteria.
  • Correctness: Your code should implement the specifications provided correctly.
  • Efficiency: While not a major factor, be prepared to have points counted off if your code is extremely inefficient (e.g., looping through a list without apparent need).

NOTE While you may work in groups to discuss strategies for solving these problems, you are expected to do your own work. Excessive similarity among answers may result in punitive action.

Part 1. Basic Analysis

You are provided a file, movie_metadata.csv, that contains data from the Internet Movie Database (IMDb) for around 5,000 movies. This file came from Kaggle's datasets. Use this file to answer the following questions.

Useful Libraries

  • Pandas - You should have experience with the pandas library from 126, and I encourage you to use pandas here to read the CSV file.
  • Matplotlib - In this class, you recently learned about Matplotlib. You can use this library to plot answers for the questions below or use Pandas's built-in graphing capabilities.
In [1]:
# Read the movie data file in here as you will reference it often during this homework

## IMPLEMENT HERE ##
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd

# Read data into data frame, dropping rows with not-a-number values
df = pd.read_csv("movie_metadata.csv", header=0).dropna(axis=0)

Columns of Interest

The movie_metadata.csv file contains 28 columns of data, but for this question, we'll only look at the following columns:

  • movie_title: Movie title,
  • gross: Gross income,
  • title_year: Release year,
  • genres: A string of movie genres, separated by "|",
  • content_rating: Movie rating,
  • language: Movie language,
  • budget: Money spent making the movie,
  • imdb_score: IMDb score, and
  • movie_facebook_likes: Facebook likes.

Question 1. Top Movies by Gross, IMDb Score, and Facebook Likes

Use the data file to find the top 3 highest grossing movie titles. For each movie, print its title, rank, gross income, rating, and genres.

As an example (this output shows formatting only; Hackers is not the highest grossing movie):

Rank 1: Hackers, $7564000, PG-13, Comedy|Crime|Drama|Thriller    
Rank 2: Hackers 2, $7564000, PG-13, Comedy|Crime|Drama|Thriller    
Rank 3: Hackers 3, $7564000, PG-13, Comedy|Crime|Drama|Thriller

Repeat this procedure for IMDb score and Facebook Likes.

In [2]:
## Implement your code here

print("By gross...")
rank = 1
for row in df.sort_values(by="gross", ascending=False).head(3).itertuples(False):
    print("Rank %s:" % rank, row.movie_title, ",", row.gross, ",", row.content_rating, ",", row.genres)
    rank += 1
    
print()
print("By IMDb Score...")
rank = 1
for row in df.sort_values(by="imdb_score", ascending=False).head(3).itertuples(False):
    print("Rank %s:" % rank, row.movie_title, ",", row.imdb_score, ",", row.content_rating, ",", row.genres)
    rank += 1
    
print()
print("By Facebook Likes...")
rank = 1
for row in df.sort_values(by="movie_facebook_likes", ascending=False).head(3).itertuples(False):
    print("Rank %s:" % rank, row.movie_title, ",", row.movie_facebook_likes, ",", row.content_rating, ",", row.genres)
    rank += 1
By gross...
Rank 1: Avatar  , 760505847.0 , PG-13 , Action|Adventure|Fantasy|Sci-Fi
Rank 2: Titanic  , 658672302.0 , PG-13 , Drama|Romance
Rank 3: Jurassic World  , 652177271.0 , PG-13 , Action|Adventure|Sci-Fi|Thriller

By IMDb Score...
Rank 1: The Shawshank Redemption  , 9.3 , R , Crime|Drama
Rank 2: The Godfather  , 9.2 , R , Crime|Drama
Rank 3: The Dark Knight  , 9.0 , PG-13 , Action|Crime|Drama|Thriller

By Facebook Likes...
Rank 1: Interstellar  , 349000 , PG-13 , Adventure|Drama|Sci-Fi
Rank 2: Django Unchained  , 199000 , R , Drama|Western
Rank 3: Batman v Superman: Dawn of Justice  , 197000 , PG-13 , Action|Adventure|Sci-Fi

Question 2. Gross Income By Year

Construct a plot that relates release years to total income and average income for that year.

NOTE: Gross income may dominate the graph. To adjust, you could use the plt.semilogy() plot instead of a standard plot. This function plots the y-axis in a logarithmic scale.

  • What year had the highest total income? 2012
  • What year had the highest average income? 1937
In [6]:
# Get each unique year in our dataset
years = set(df.title_year)
yearEarningDict = {}

# For every year, find all movies released that year, and calc
#  their sum and avg incomes
for year in years:
    # all movies released this year
    thisYearDf = df[df.title_year == year]
    
    # Sum across the gross column
    sumGross = sum(thisYearDf.gross)
    
    # Divide sum by number of movies
    avgGross = sumGross / thisYearDf.shape[0]
    
    # Update dictionary with the sum and avg for this year
    yearEarningDict[year] = (sumGross, avgGross)
    
# Convert dictionary to sorted lists for display
sortedYears = sorted(years)
totalIncome = []
avgIncome = []
for year in sortedYears:
    totalIncome.append(yearEarningDict[year][0])
    avgIncome.append(yearEarningDict[year][1])
    
# Construct graphs over years and income
plt.semilogy(sortedYears, totalIncome, label="Total")
plt.semilogy(sortedYears, avgIncome, label="Average")
plt.legend()
plt.grid()
plt.show()

# Get the best years by sorting by sum and avg in our dictionary
bestSumYear = sorted(yearEarningDict, key=lambda x: yearEarningDict[x][0])[-1]
bestAvgYear = sorted(yearEarningDict, key=lambda x: yearEarningDict[x][1])[-1]
print("Highest Sum Year:", bestSumYear, yearEarningDict[bestSumYear])
print("Highest Avg Year:", bestAvgYear, yearEarningDict[bestAvgYear])
Highest Sum Year: 2012.0 (10899163619.0, 68982048.221518993)
Highest Avg Year: 1937.0 (184925485.0, 184925485.0)

Question 3. Gross Income By Language

Plot movie languages to total income and average income for each language.

NOTE You can use different graphs here, but the matplotlib.bar() function might be best. You can provide it range for x coordinates, and income data for y coordinates. I also suggest you plot these on two different plots (recall you can call plt.show() to create a plot and can call it multiple times to create multiple plots).

To make the graph more legible, refer to the plt.xticks() function, which takes a list of indices, a list of string labels, and an optional rotation argument that lets you rotate the labels. For example, the following will make vertically-rotated labels:

plt.xticks(range(languageDf.shape[0]), languageDf.language, rotation="vertical")

  • What language had the highest total income? English
  • What language had the highest average income? English
In [7]:
# What are the unique languages?
languages = set(df.language)

# For each language, calculate sum and gross as we did with years
languageData = []
for lang in languages:
    thisLangDf = df[df.language == lang]       
    sumGross = sum(thisLangDf.gross)
    avgGross = sumGross / thisLangDf.shape[0]
    
    # Add results as a small dictionary to list.
    #  Each element has the language, its sum, and its gross
    languageData.append({"language":lang, "total":sumGross, "avg":avgGross})

# Construct dataframe from this list of languages, then we can sort
#  like we did for gross, likes, and IMDb score
languageDf = pd.DataFrame(languageData)

print("By Total...")
for row in languageDf.sort_values(by="total", ascending=False).head(3).itertuples(False):
    print(row)
    
print("By Avg...")
for row in languageDf.sort_values(by="avg", ascending=False).head(3).itertuples(False):
    print(row)

plt.bar(range(len(languageData)), languageDf.total, label="Total")
plt.xticks(range(languageDf.shape[0]), languageDf.language, rotation="vertical")
plt.legend()
plt.grid()
plt.show()

plt.bar(range(len(languageData)), languageDf.avg, label="Average")
plt.xticks(range(languageDf.shape[0]), languageDf.language, rotation="vertical")
plt.legend()
plt.grid()
plt.show()
By Total...
Pandas(avg=54628082.780155644, language='English', total=196551841843.0)
Pandas(avg=9788979.2173913047, language='Spanish', total=225146522.0)
Pandas(avg=6412639.2647058824, language='French', total=218029735.0)
By Avg...
Pandas(avg=54628082.780155644, language='English', total=196551841843.0)
Pandas(avg=50859889.0, language='Maya', total=50859889.0)
Pandas(avg=39340394.5, language='Aboriginal', total=78680789.0)

Question 4. Gross Income By Content Rating

Plot movie ratings to total income and average income for each rating.

  • What rating had the highest total income? PG-13
  • What rating had the highest average income? G
In [8]:
## Implement your code here
ratings = set(df.content_rating)

ratingData = []
for rating in ratings:
    thisRatingDf = df[df.content_rating == rating]       
    sumGross = sum(thisRatingDf.gross)
    avgGross = sumGross / thisRatingDf.shape[0]
    ratingData.append({"rating":rating, "total":sumGross, "avg":avgGross})
ratingDf = pd.DataFrame(ratingData)

print("By Total...")
for row in ratingDf.sort_values(by="total", ascending=False).head(3).itertuples(False):
    print(row)
    
print("By Avg...")
for row in ratingDf.sort_values(by="avg", ascending=False).head(3).itertuples(False):
    print(row)

plt.plot(range(len(ratingDf)), ratingDf.total, label="Total")
plt.xticks(range(ratingDf.shape[0]), ratingDf.rating, rotation="vertical")
plt.legend()
plt.grid()
plt.show()

plt.plot(range(len(ratingDf)), ratingDf.avg, label="Average")
plt.xticks(range(ratingDf.shape[0]), ratingDf.rating, rotation="vertical")
plt.legend()
plt.grid()
plt.show()
By Total...
Pandas(avg=68965118.56039755, rating='PG-13', total=90206375077.0)
Pandas(avg=32149838.80882353, rating='R', total=54654725975.0)
Pandas(avg=77351922.091872796, rating='PG', total=43781187904.0)
By Avg...
Pandas(avg=86793282.241379306, rating='G', total=7551015555.0)
Pandas(avg=77351922.091872796, rating='PG', total=43781187904.0)
Pandas(avg=68965118.56039755, rating='PG-13', total=90206375077.0)

Question 5. Gross Income By Genre

Plot movie genres to total income and average income for each genre.

NOTE You will need to use string functions to split genres along the "|" delimiter for movies with mutliple genres.

  • What genre had the highest total income? Adventure
  • What genre had the highest average income? Adventure
In [9]:
## Implement your code here
genreStrings = set(df.genres)
genres = set()
for gStr in genreStrings:
    for g in gStr.split("|"):
        genres.add(g)

genreData = []
for genre in genres:
    thisGenreDf = df[df.genres.str.contains(genre)]       
    sumGross = sum(thisGenreDf.gross)
    avgGross = sumGross / thisRatingDf.shape[0]
    genreData.append({"genre":genre, "total":sumGross, "avg":avgGross})
genreDf = pd.DataFrame(genreData)

print("By Total...")
for row in genreDf.sort_values(by="total", ascending=False).head(3).itertuples(False):
    print(row)
    
print("By Avg...")
for row in genreDf.sort_values(by="avg", ascending=False).head(3).itertuples(False):
    print(row)

plt.bar(range(len(genreDf)), genreDf.total, label="Total")
plt.xticks(range(genreDf.shape[0]), genreDf.genre, rotation="vertical")
plt.legend()
plt.grid()
plt.show()

plt.bar(range(len(genreDf)), genreDf.avg, label="Average")
plt.xticks(range(genreDf.shape[0]), genreDf.genre, rotation="vertical")
plt.legend()
plt.grid()
plt.show()
By Total...
Pandas(avg=906832014.75862074, genre='Adventure', total=78894385284.0)
Pandas(avg=865386698.1839081, genre='Comedy', total=75288642742.0)
Pandas(avg=858940806.35632181, genre='Action', total=74727850153.0)
By Avg...
Pandas(avg=906832014.75862074, genre='Adventure', total=78894385284.0)
Pandas(avg=865386698.1839081, genre='Comedy', total=75288642742.0)
Pandas(avg=858940806.35632181, genre='Action', total=74727850153.0)

Question 6. Gross Income Versus Facebook Likes

Plot movie gross income to Facebook Likes. You can do this using plt.scatter() or with Pandas.

  • Do likes on Facebook seem to be a good predictor for movie income?

No, there appears to be little correlation between gross income and likes. You see movies like Avatar with the highest income and few likes, or Interstellar with the highest likes but relatively low gross.

In [104]:
## Implement your code here

df.plot.scatter("gross", "movie_facebook_likes")
Out[104]:
<matplotlib.axes._subplots.AxesSubplot at 0x11a47bf28>

Question 7. Gross Income Versus IMDb Score

Plot movie gross income to IMDb Score.

  • Does the IMDb score seem to be a good predictor for movie income?

It appears better than Facebook likes, but the majority of IMDb's high-scoring mass is located in low-grossing movies. At least highly grossing movies tend to have higher IMDb scores, which suggests some valid, positive correlation.

In [105]:
## Implement your code here

df.plot.scatter("gross", "imdb_score")
Out[105]:
<matplotlib.axes._subplots.AxesSubplot at 0x11ab26588>

Question 8. Movie Profitability

To determine a movie's profits, subtract the movie's budget from its gross earnings. Use this formula to identify the top 3 most profitable movies.

  • Are these the same as the highest grossing? Yes
In [108]:
## Implement your code here

df["profit"] = df["gross"] - df["budget"]

print("By gross...")
rank = 1
for row in df.sort_values(by="profit", ascending=False).head(3).itertuples(False):
    print("Rank %s:" % rank, row.movie_title, ",", row.profit, ",", row.content_rating, ",", row.genres)
    rank += 1
By gross...
Rank 1: Avatar  , 523505847.0 , PG-13 , Action|Adventure|Fantasy|Sci-Fi
Rank 2: Jurassic World  , 502177271.0 , PG-13 , Action|Adventure|Sci-Fi|Thriller
Rank 3: Titanic  , 458672302.0 , PG-13 , Drama|Romance

Question 9. Percent Return

The large numbers for highest grossing films may dominate profitability analysis. A better test is to look at movie return as a percent of the budget. That is, a low-budget movie that makes a lot has a better return than a high-budget film with the same gross income.

Calculate the ratio between gross income and budget to determine the percent return for each movie, and print the top 3 highest returning movies.

  • Are these the same as the highest grossing? No
In [112]:
## Implement your code here

df["percent"] = df["gross"] / df["budget"]

print("By gross...")
rank = 1
for row in df.sort_values(by="percent", ascending=False).head(3).itertuples(False):
    print("Rank %s:" % rank, row.movie_title, ",", row.precent, ",", row.content_rating, ",", row.genres)
    rank += 1
By gross...
Rank 1: Paranormal Activity  , 7194.48553333 , R , Horror
Rank 2: Tarnation  , 2715.66055046 , Unrated , Biography|Documentary
Rank 3: The Blair Witch Project  , 2342.16856667 , R , Horror

Question 10. Average Genre Return

Using the percent return you calculated above, plot the average percent return for each genre.

  • What are the 3 genres with the highest return? See code
  • What are the 3 genres with the lowest return? See code
In [115]:
## Implement your code here
genreData = []
for genre in genres:
    thisGenreDf = df[df.genres.str.contains(genre)]       
    genreData.append({"genre":genre, "percentRet":thisGenreDf.percent.mean()})
genreDf = pd.DataFrame(genreData)

print("By Return...")
for row in genreDf.sort_values(by="percentRet", ascending=False).head(3).itertuples(False):
    print(row)

plt.bar(range(len(genreDf)), genreDf["percentRet"], label="Average")
plt.xticks(range(genreDf.shape[0]), genreDf.genre, rotation="vertical")
plt.legend()
plt.grid()
plt.show()
By Return...
Pandas(genre='Documentary', percentRet=70.966984265419981)
Pandas(genre='Horror', percentRet=31.655073852703463)
Pandas(genre='Biography', percentRet=13.412919533000633)

Part 2. Actor Costars

The movie_metadata.csv also contains columns, actor_X_name, for the first three top-billed actors in each movie. Use these columns for the following questions.

Question 1. Highest Grossing Stars

As with finding the top-grossing movies, print the top 3 highest grossing actors/actresses. These people will have the highest sum of gross movie income. That is, for each actor, sum all the gross numbers for each movie in which he/she has appeared in the top 3 billings, and order the actors by this sum.

As with the top-grossing movies, print the top 3 actors and their summed gross income in a format similar to the following:

Rank 1: Angelina Jolie, $7564000
Rank 2: Johnny Lee Miller, $7564000
Rank 3: Brad Pitt, $7564000

NOTE: Depending on how efficient your code is, it may take a minute to execute.

In [10]:
# A set of unique actors
actors = set()

# restrict ourselves to the actor columnes
actorColumns = ["actor_1_name", "actor_2_name", "actor_3_name"]

# For each row, add each actor to the set of actors
for row in df[actorColumns].itertuples(False):
    for actor in row:
        actors.add(actor)

# Dictionary of actor names -> gross
actorDict = {}

# For each actor, find all movies in which that actor appeared...
for actor in actors:
    bill = df[(df["actor_1_name"] == actor) | (df["actor_2_name"] == actor) | (df["actor_3_name"] == actor)]
    
    # And set the summed gross to that actor's value
    actorDict[actor] = bill["gross"].sum()
In [11]:
# Sort the actors by their gross, reversing to the get the highest first
sortedActors = sorted(actorDict, key=actorDict.get, reverse=True)

# Temp variable for counting rank
rank = 1

# For top three actors, print rank, name, and gross
for actor in sortedActors[:3]:
    print("Rank %s:" % rank, actor, ", $", actorDict[actor])
    rank+=1
Rank 1: Robert Downey Jr. , $ 4162540754.0
Rank 2: Scarlett Johansson , $ 4141343253.0
Rank 3: Morgan Freeman , $ 3938458613.0

Question 2. Creating a Map of the Stars

Iterate through the movies file and construct a dictionary that maps each star to his/her costars. Use this dictionary to print all the costars of the top 3 highest grossing actors.

An example format might be:

Rank 1: Angelina Jolie
    Costar: Johnny Lee Miller
    Costar: Brad Pitt
    Costar: Antonio Banderas
Rank 2: etc...

NOTE Be sure and exclude the target actor from his/her list of costars. E.g., Robert Downey Jr. is not a costar of himself.

In [139]:
# Dictionary mapping actor to actor's costars
costarDict = {}

# For each actor in our list of sorted actors...
for actor in sortedActors:
    
    # Find all movies in which that actor appeared, as before
    bill = df[(df["actor_1_name"] == actor) | (df["actor_2_name"] == actor) | (df["actor_3_name"] == actor)]
    
    # Create a set of costars
    costars = set()
    
    # For each movie, add fellow actors (i.e., costars) to dictionary
    for movieIndex, movie in bill.iterrows():
        for actorCol in actorColumns:
            costars.add(movie[actorCol])

    # Remove empty sets
    costarDict[actor] = costars - set()
    
# Print costars for top three actors
rank = 1
for actor in sortedActors[:3]:
    print("Rank %d:" % rank, actor)
    for costar in costarDict[actor]:
        print("\tCostar:", costar)
Rank 1: Robert Downey Jr.
	Costar: Brandon T. Jackson
	Costar: Matt Walsh
	Costar: Keanu Reeves
	Costar: Scarlett Johansson
	Costar: Hope Davis
	Costar: Tate Donovan
	Costar: Alfre Woodard
	Costar: Rachael Harris
	Costar: Paul Anderson
	Costar: Robert Maillet
	Costar: Robin Wright
	Costar: Joel David Moore
	Costar: Chris Hemsworth
	Costar: Bernard Hill
	Costar: Chris Evans
	Costar: Angel David
	Costar: Aidan Quinn
	Costar: Stephen Root
	Costar: Kristin Scott Thomas
	Costar: Anthony Edwards
	Costar: Eddie Marsan
	Costar: RZA
	Costar: Richard Thomas
	Costar: Jon Favreau
	Costar: Robert Downey Jr.
	Costar: Kristin Davis
	Costar: Steve Coogan
	Costar: Matt Servitto
	Costar: Robert Duvall
	Costar: Jamie Kennedy
	Costar: Megan Park
	Costar: Charles S. Dutton
	Costar: Corbin Bernsen
	Costar: Leighton Meester
	Costar: Adam Alexi-Malle
	Costar: Paul Guilfoyle
	Costar: Natasha Gregson Wagner
	Costar: Ty Burrell
	Costar: Larry Miller
	Costar: Steve Guttenberg
	Costar: Kelvin Han Yee
	Costar: Alex Borstein
	Costar: Rory Cochrane
	Costar: Holly Hunter
	Costar: Jeff Bridges
	Costar: Don Cheadle
	Costar: Jake Gyllenhaal
	Costar: Jim Broadbent
	Costar: Rip Torn
Rank 1: Scarlett Johansson
	Costar: Doug E. Doug
	Costar: Christian Bale
	Costar: Scarlett Johansson
	Costar: Garry Shandling
	Costar: Bill Murray
	Costar: Benedict Cumberbatch
	Costar: Djimon Hounsou
	Costar: Penelope Wilton
	Costar: Chris Hemsworth
	Costar: Chris Evans
	Costar: Amr Waked
	Costar: Christopher Evan Welch
	Costar: Kevin McNally
	Costar: Matt Letscher
	Costar: Brian Johnson
	Costar: Kristin Scott Thomas
	Costar: Bill Fagerbakke
	Costar: Catherine Lambert
	Costar: Jon Favreau
	Costar: Alden Ehrenreich
	Costar: Robert Downey Jr.
	Costar: Hayley Atwell
	Costar: Tony Danza
	Costar: Geoff Bell
	Costar: Channing Tatum
	Costar: Joseph Gordon-Levitt
	Costar: Kevin Dunn
	Costar: Mia Kirshner
	Costar: Mark Gatiss
	Costar: Steve Buscemi
	Costar: Dennis Quaid
	Costar: T.J. Thyne
	Costar: Louis Lombardi
	Costar: Riley Smith
	Costar: Ty Burrell
	Costar: Mike Starr
	Costar: Natalie Portman
	Costar: Morgan Freeman
	Costar: Jaime King
	Costar: Rodger Bumpass
	Costar: Hugh Jackman
	Costar: Jessalyn Gilsig
Rank 1: Morgan Freeman
	Costar: Common
	Costar: Lisa Ann Walter
	Costar: Randy Quaid
	Costar: Radha Mitchell
	Costar: Andrew Wilson
	Costar: Alison Brie
	Costar: Robert De Niro
	Costar: Heath Ledger
	Costar: Anthony Hopkins
	Costar: Philip Baker Hall
	Costar: Reg E. Cathey
	Costar: Liam Neeson
	Costar: Reece Thompson
	Costar: Angelina Jolie Pitt
	Costar: Johnny Depp
	Costar: Romany Malco
	Costar: Billy Burke
	Costar: Tom Cruise
	Costar: Alan Rickman
	Costar: Adam Scott
	Costar: Denzel Washington
	Costar: Bruce Willis
	Costar: Robert Duvall
	Costar: Steve Carell
	Costar: Kevin Dunn
	Costar: Michael Kelly
	Costar: Rene Russo
	Costar: Kathleen Wilhoite
	Costar: Taylor Blackwell
	Costar: Jet Li
	Costar: Patti LuPone
	Costar: Clifton Collins Jr.
	Costar: Morgan Freeman
	Costar: Matthew Broderick
	Costar: Frances Fisher
	Costar: Brad Pitt
	Costar: Bob Hoskins
	Costar: Willie Nelson
	Costar: Clint Eastwood
	Costar: Leleti Khumalo
	Costar: Gerard Butler
	Costar: Christian Bale
	Costar: Noel Gugliemi
	Costar: Keanu Reeves
	Costar: Lynda Boyd
	Costar: Daniel Radcliffe
	Costar: Mike Colter
	Costar: Tatyana Ali
	Costar: Scarlett Johansson
	Costar: Jeffrey DeMunn
	Costar: Jaqueline Fleming
	Costar: Michael Roark
	Costar: Amr Waked
	Costar: Sanaa Lathan
	Costar: Minnie Driver
	Costar: Bob Gunton
	Costar: Jimmy Bennett
	Costar: Monica Potter
	Costar: Will Ferrell
	Costar: Zoë Bell
	Costar: Jon Favreau
	Costar: Romane Bohringer
	Costar: Pruitt Taylor Vince
	Costar: Bruce McGill
	Costar: Matthew McConaughey
	Costar: Bruce Davison
	Costar: Seth MacFarlane
	Costar: Tony Goldwyn
	Costar: Michael Wincott
	Costar: Michael O'Neill
	Costar: Camryn Manheim
	Costar: Dorian Missick
	Costar: Jessica Tandy
	Costar: Sofie Gråbøl
	Costar: Kevin Spacey
	Costar: Sean Hayes
	Costar: Harry Connick Jr.
	Costar: Matt Damon

Question 3. Six Two Degrees of Kevin Bacon

In the 90’s before Google was around, people used to play a game called Six Degrees from Kevin Bacon. Kevin Bacon was a relatively well-known actor at the time who was said to be connected to almost anyone in the movie industry.

The game was played by asking your friend to name a random actor. Using that random actor as a starting point, you’d choose a movie the actor was in, and then choose a costar – a first-degree costar, so to speak – from that movie. Then you’d choose a second-degree costar who shared a different movie with the first-degree costar, and so on. The goal of the game was to connect back to Kevin Bacon within six degrees (i.e. within six costars away), and since Google wasn’t around, it was pretty impressive if someone could. Here’s a video on Youtube that demonstrates it.

This question attempts to re-create that game, except it will only go to two degrees because our computers will (figuratively) explode if they try to do six degrees.

Using the code and the dictionary you developed above, write a function find_cocostars() that takes as an argument an actor's name target_actor and the costar dictionary you just made and returns a list of tuples. Each tuple should contain the costar's degree from the given target actor and the costar's name. This degree is a number indicating whether the actor is a direct co-star $degree == 1$ or a co-start of a co-star $degree == 2$.

Use this function to print all the first- and second-degree co-stars of Angelina Jolie Pitt.

A sample output may look like:

Actor: Angeline Jolie Pitt
    Degree 1: Brad Pitt
    Degree 1: Johnny Depp
    ...
        Degree 2: Charlize Theron
        Degree 2: Meryl Streep
        Degree 2: Bob Hoskins
        ...

NOTE There will be a lot of degree-2 co-stars.

In [142]:
## Implement your code here

def find_cocostars(target_actor, costar_dict):
    """Looks up all the co-stars for a target actor. Returns a list of 
    tuples containing (degree, costar) where degree equals 1 or 2.

    Parameters:
    target_actor: Target actor name
    costar_dict: dictionary of costars
    
    Usage Examples:
    >>> target = "Angelina Jolie Pitt"
    >>> twoDegreeCostars = find_cocostars(target, costarDict)
    >>> print("Number of <= 2-degree costars:", len(twoDegreeCostars))
    >>> print("Actor:", target)
    >>> for degree, costar in twoDegreeCostars:
    >>>     if ( degree == 1 ):
    >>>         print("\tDegree 1:", costar)
    >>>     else:
    >>>         print("\t\tDegree 2:", costar)
    Number of <= 2-degree costars: 832
    Actor: Angelina Jolie Pitt
        Degree 1: August Diehl
        Degree 1: Stockard Channing
        ...
        Degree 1: Martin Scorsese
            Degree 2: Nathan Lane
            Degree 2: Dianne Wiest
            Degree 2: Joe Mantegna
            ...
    """
    # List of costars for the target actor
    costars = []
    
    # Set to hold unique costars, which we use for ensuring we only
    #  show an actor once
    firstDegreeCostars = set()
    
    # For each costar of this target actor...
    for costar in costar_dict[target_actor]:
        
        # Add a tuple ot this list of costars with degree and name
        costars.append((1, costar))
        
        # Add costar name to set of costars
        firstDegreeCostars.add(costar)
        
    # Iterate through first-degree costars, adding co-costars
    for costar in firstDegreeCostars:
        
        # For each costar of this costar...
        for cocostar in costar_dict[costar]:
            
            # Check if we haven't already seen this actor and this actor
            #  isn't the target actor
            if ( cocostar not in firstDegreeCostars and cocostar != target_actor):
                
                # If unseen and not target, add tuple to costar list
                costars.append((2, cocostar))
            
    # Return list of costars and degrees
    return costars

target = "Angelina Jolie Pitt"
twoDegreeCostars = find_cocostars(target, costarDict)
print("Number of <= 2-degree costars:", len(twoDegreeCostars))
print("Actor:", target)
for degree, costar in twoDegreeCostars:
    if ( degree == 1 ):
        print("\tDegree 1:", costar)
    else:
        print("\t\tDegree 2:", costar)
Number of <= 2-degree costars: 832
Actor: Angelina Jolie Pitt
	Degree 1: August Diehl
	Degree 1: Stockard Channing
	Degree 1: Common
	Degree 1: Teri Polo
	Degree 1: Jake Weber
	Degree 1: Robert De Niro
	Degree 1: Rufus Sewell
	Degree 1: Djimon Hounsou
	Degree 1: Gregory Itzin
	Degree 1: Stephanie March
	Degree 1: Leland Orser
	Degree 1: Sharlto Copley
	Degree 1: Laurence Olivier
	Degree 1: Anthony Hopkins
	Degree 1: Chris Barrie
	Degree 1: Dan Fogler
	Degree 1: Fisher Stevens
	Degree 1: Angelina Jolie Pitt
	Degree 1: Johnny Depp
	Degree 1: Clea DuVall
	Degree 1: Kurt Fuller
	Degree 1: J.K. Simmons
	Degree 1: Archie Panjabi
	Degree 1: Noah Emmerich
	Degree 1: Lorraine Bracco
	Degree 1: Denzel Washington
	Degree 1: Robert Duvall
	Degree 1: Colm Feore
	Degree 1: Bai Ling
	Degree 1: Andre Braugher
	Degree 1: Michael Kelly
	Degree 1: Gary Oldman
	Degree 1: Nicolas Cage
	Degree 1: James Gammon
	Degree 1: Wayne Knight
	Degree 1: Vanessa Redgrave
	Degree 1: Melvil Poupaud
	Degree 1: Mike Bell
	Degree 1: Morgan Freeman
	Degree 1: Dan Futterman
	Degree 1: Brian Blessed
	Degree 1: Brad Pitt
	Degree 1: Noah Taylor
	Degree 1: Jack Thompson
	Degree 1: Sam Riley
	Degree 1: Gerard Butler
	Degree 1: Martin Scorsese
		Degree 2: Nathan Lane
		Degree 2: Dianne Wiest
		Degree 2: Joe Mantegna
		Degree 2: Woody Allen
		Degree 2: Goran Visnjic
		Degree 2: Elizabeth Berkley
		Degree 2: Raymond Cruz
		Degree 2: John Larroquette
		Degree 2: Victor Webster
		Degree 2: Elizabeth Perkins
		Degree 2: Natalie Portman
		Degree 2: Sid Caesar
		Degree 2: James Frain
		Degree 2: Stephen Collins
		Degree 2: Olivia Newton-John
		Degree 2: Bruce McGill
		Degree 2: Christian Bale
		Degree 2: Odeya Rush
		Degree 2: Ryan Reynolds
		Degree 2: Lauryn Hill
		Degree 2: Robin Williams
		Degree 2: Seth Meyers
		Degree 2: Liam Neeson
		Degree 2: Alex Rocco
		Degree 2: Dave Chappelle
		Degree 2: Bryce Dallas Howard
		Degree 2: Jennifer Garner
		Degree 2: Harrison Ford
		Degree 2: Oleg Taktarov
		Degree 2: Randy Quaid
		Degree 2: Bill Murray
		Degree 2: Kyra Sedgwick
		Degree 2: David Gallagher
		Degree 2: Viggo Mortensen
		Degree 2: Charlize Theron
		Degree 2: Katy Mixon
		Degree 2: Dwight Yoakam
		Degree 2: Will Ferrell
		Degree 2: Bill Cobbs
		Degree 2: Jon Favreau
		Degree 2: Haley Joel Osment
		Degree 2: Marlon Brando
		Degree 2: Josh Hutcherson
		Degree 2: Tom Cruise
		Degree 2: Robert Downey Jr.
		Degree 2: Julian Richings
		Degree 2: Michael Rapaport
		Degree 2: Kathleen Quinlan
		Degree 2: Demi Moore
		Degree 2: Tony Goldwyn
		Degree 2: Leighton Meester
		Degree 2: Kelvin Han Yee
		Degree 2: Emmanuelle Vaugier
		Degree 2: Michael Jeter
		Degree 2: J.T. Walsh
		Degree 2: David Oyelowo
		Degree 2: Al Pacino
		Degree 2: Antoni Corone
		Degree 2: Sydney Pollack
		Degree 2: Steve Buscemi
		Degree 2: Blythe Danner
		Degree 2: Matt O'Leary
		Degree 2: Nonso Anozie
		Degree 2: Tom Wilkinson
		Degree 2: Gemma Chan
		Degree 2: Chita Rivera
		Degree 2: JR Bourne
		Degree 2: Peter Fonda
		Degree 2: Mara Wilson
		Degree 2: Jayne Eastwood
		Degree 2: Gil Birmingham
		Degree 2: Salma Hayek
		Degree 2: Scout Taylor-Compton
		Degree 2: Michael Wincott
		Degree 2: David Patrick Kelly
		Degree 2: Randall Duk Kim
		Degree 2: Geoffrey Palmer
		Degree 2: Will Smith
		Degree 2: Channing Tatum
		Degree 2: Dylan Baker
		Degree 2: Matt Craven
		Degree 2: Munro Chambers
		Degree 2: Paul Sorvino
		Degree 2: Robin Williams
		Degree 2: Robert John Burke
		Degree 2: James Russo
		Degree 2: Kristen Stewart
		Degree 2: Don Rickles
		Degree 2: Leonardo DiCaprio
		Degree 2: Philip Baker Hall
		Degree 2: Cathy Moriarty
		Degree 2: Sid Haig
		Degree 2: Chazz Palminteri
		Degree 2: Romany Malco
		Degree 2: Jonathan Winters
		Degree 2: Chris Bauer
		Degree 2: Frances Conroy
		Degree 2: Marlon Brando
		Degree 2: Kelsey Grammer
		Degree 2: Michael Rapaport
		Degree 2: Joe Don Baker
		Degree 2: 50 Cent
		Degree 2: Blythe Danner
		Degree 2: Frank Vincent
		Degree 2: Brendan Sexton III
		Degree 2: Demi Moore
		Degree 2: Philip Seymour Hoffman
		Degree 2: Bradley Cooper
		Degree 2: Robert Forster
		Degree 2: Kevin Pollak
		Degree 2: Rene Russo
		Degree 2: Sylvester Stallone
		Degree 2: Michael Lonsdale
		Degree 2: Oscar Gale
		Degree 2: Mike Starr
		Degree 2: Ben Mendelsohn
		Degree 2: John Doman
		Degree 2: F. Murray Abraham
		Degree 2: Bob Hoskins
		Degree 2: David Carradine
		Degree 2: David Proval
		Degree 2: Janeane Garofalo
		Degree 2: Billy Drago
		Degree 2: Jason Mantzoukas
		Degree 2: Ellen Barkin
		Degree 2: Robert Mitchum
		Degree 2: Treat Williams
		Degree 2: Meryl Streep
		Degree 2: Robin Wright
		Degree 2: Charlize Theron
		Degree 2: Topher Grace
		Degree 2: Burt Young
		Degree 2: Minnie Driver
		Degree 2: Gary Farmer
		Degree 2: Kirsten Dunst
		Degree 2: Milla Jovovich
		Degree 2: Yaphet Kotto
		Degree 2: Natascha McElhone
		Degree 2: Dylan Baker
		Degree 2: Zoey Deutch
		Degree 2: Anne Hathaway
		Degree 2: Jennifer Lawrence
		Degree 2: Seth Meyers
		Degree 2: John Michael Higgins
		Degree 2: Joe Viterelli
		Degree 2: James Franco
		Degree 2: Cameron Bright
		Degree 2: Geraldine Chaplin
		Degree 2: James Frain
		Degree 2: Al Pacino
		Degree 2: Molly Shannon
		Degree 2: Don Johnson
		Degree 2: Jason Statham
		Degree 2: Charles Martin Smith
		Degree 2: Cheech Marin
		Degree 2: Jim Broadbent
		Degree 2: Jimmy Bennett
		Degree 2: Harry Lennix
		Degree 2: Bernie Mac
		Degree 2: Dennis Quaid
		Degree 2: Chris Evans
		Degree 2: Mike Vogel
		Degree 2: Ioan Gruffudd
		Degree 2: Kate Winslet
		Degree 2: William Hurt
		Degree 2: Jake Wood
		Degree 2: Sarah Parish
		Degree 2: Bruce Spence
		Degree 2: Heath Ledger
		Degree 2: Angela Bettis
		Degree 2: Bérénice Bejo
		Degree 2: Dwayne Johnson
		Degree 2: Jimmy Smits
		Degree 2: Ingrid Bolsø Berdal
		Degree 2: Rupert Graves
		Degree 2: Eddie Marsan
		Degree 2: Benjamin Walker
		Degree 2: Bridgette Wilson-Sampras
		Degree 2: Dominic Cooper
		Degree 2: Alex Jennings
		Degree 2: Oliver Reed
		Degree 2: Gary Lewis
		Degree 2: Scarlett Johansson
		Degree 2: Boris Kodjoe
		Degree 2: Dougray Scott
		Degree 2: Christina Milian
		Degree 2: Vin Diesel
		Degree 2: Tom Conti
		Degree 2: Bradley Cooper
		Degree 2: Steve Buscemi
		Degree 2: Reeve Carney
		Degree 2: Leslie Hope
		Degree 2: Ed Speleers
		Degree 2: Alison Lohman
		Degree 2: America Ferrera
		Degree 2: Neil Brown Jr.
		Degree 2: Leonardo DiCaprio
		Degree 2: Stephen Collins
		Degree 2: Olivia Williams
		Degree 2: Lucy Gordon
		Degree 2: Jason Flemyng
		Degree 2: Wes Studi
		Degree 2: Connie Nielsen
		Degree 2: Jeff Bridges
		Degree 2: Tom Goodman-Hill
		Degree 2: Bruce Willis
		Degree 2: Kevin Brown
		Degree 2: Robin Wright
		Degree 2: Charlotte Sullivan
		Degree 2: Jon Stewart
		Degree 2: Ashley Hinshaw
		Degree 2: Martin Henderson
		Degree 2: Kim Shaw
		Degree 2: Tony Nappo
		Degree 2: Matt Damon
		Degree 2: Alex Russell
		Degree 2: Leslie Bibb
		Degree 2: Brian Van Holt
		Degree 2: Louis Lombardi
		Degree 2: Beau Bridges
		Degree 2: Tony Curran
		Degree 2: Alice Braga
		Degree 2: Jose Pablo Cantillo
		Degree 2: Hugh Jackman
		Degree 2: Jed Brophy
		Degree 2: Jason Cope
		Degree 2: Matt Damon
		Degree 2: Harrison Ford
		Degree 2: Keanu Reeves
		Degree 2: Daniel Radcliffe
		Degree 2: William Hurt
		Degree 2: Atticus Shaffer
		Degree 2: Benedict Cumberbatch
		Degree 2: Robin Wright
		Degree 2: Kodi Smit-McPhee
		Degree 2: Jaleel White
		Degree 2: Abbie Cornish
		Degree 2: Lena Olin
		Degree 2: Rachel Brosnahan
		Degree 2: Jennifer Ehle
		Degree 2: Dwayne Johnson
		Degree 2: Milla Jovovich
		Degree 2: Billy Burke
		Degree 2: Michael Rapaport
		Degree 2: Doug Cockle
		Degree 2: Bruce Willis
		Degree 2: Mila Kunis
		Degree 2: Courtney Love
		Degree 2: Demi Moore
		Degree 2: Eric Idle
		Degree 2: William Petersen
		Degree 2: June Lockhart
		Degree 2: Dean Stockwell
		Degree 2: Michael Wincott
		Degree 2: Colin Firth
		Degree 2: Jordi Mollà
		Degree 2: Virginia Madsen
		Degree 2: Judy Greer
		Degree 2: Jeff Bridges
		Degree 2: James Corden
		Degree 2: Rupert Grint
		Degree 2: Christopher Lambert
		Degree 2: Jeremy Crutchley
		Degree 2: Marc Anthony
		Degree 2: Ryan Reynolds
		Degree 2: Tye Sheridan
		Degree 2: Hope Davis
		Degree 2: Anthony Heald
		Degree 2: Valeria Golino
		Degree 2: Roger Willie
		Degree 2: Meryl Streep
		Degree 2: Charlize Theron
		Degree 2: Matt Long
		Degree 2: Chandler Canterbury
		Degree 2: Katy Mixon
		Degree 2: Michael Rispoli
		Degree 2: Fred Gwynne
		Degree 2: Sami Gayle
		Degree 2: Julian Sands
		Degree 2: Philip Baker Hall
		Degree 2: Spencer Wilding
		Degree 2: Kathleen Turner
		Degree 2: James With
		Degree 2: Omar Benson Miller
		Degree 2: Chris Bauer
		Degree 2: Billy Burke
		Degree 2: Emma Stone
		Degree 2: Bokeem Woodbine
		Degree 2: Annie Parisse
		Degree 2: Michael Rapaport
		Degree 2: CCH Pounder
		Degree 2: Armando Riesco
		Degree 2: Charlie Yeung
		Degree 2: Mark Valley
		Degree 2: Shawn Hatosy
		Degree 2: Amber Valletta
		Degree 2: Michael Biehn
		Degree 2: Shea Whigham
		Degree 2: Mike Starr
		Degree 2: Lea Thompson
		Degree 2: Ben Mendelsohn
		Degree 2: Robert Capron
		Degree 2: Jared Burke
		Degree 2: Joan Allen
		Degree 2: Peter Fonda
		Degree 2: Ronnie Gene Blevins
		Degree 2: Sonja Sohn
		Degree 2: Dee Bradley Baker
		Degree 2: Bob Hoskins
		Degree 2: Don Cheadle
		Degree 2: Jay Hernandez
		Degree 2: Quinton Aaron
		Degree 2: Julia Roberts
		Degree 2: John Heard
		Degree 2: Dylan Baker
		Degree 2: Liam Neeson
		Degree 2: Ariana Richards
		Degree 2: Michael Jordan
		Degree 2: Holland Taylor
		Degree 2: Bill Murray
		Degree 2: Bob Peck
		Degree 2: Tom Hanks
		Degree 2: Colin Salmon
		Degree 2: Julie Benz
		Degree 2: Kurtwood Smith
		Degree 2: John Ratzenberger
		Degree 2: Natasha Richardson
		Degree 2: Luisa Ranieri
		Degree 2: Emily Watson
		Degree 2: Kristin Scott Thomas
		Degree 2: Bill Murray
		Degree 2: David Oyelowo
		Degree 2: Alex Pettyfer
		Degree 2: Rafe Spall
		Degree 2: Tom Cruise
		Degree 2: Lynn Redgrave
		Degree 2: Joely Richardson
		Degree 2: Marcia DeBonis
		Degree 2: Ben Chaplin
		Degree 2: Julia Ormond
		Degree 2: Maura Tierney
		Degree 2: Craig Hall
		Degree 2: Keanu Reeves
		Degree 2: Kate Winslet
		Degree 2: Emily Watson
		Degree 2: Hope Davis
		Degree 2: Tony Amendola
		Degree 2: Anthony Heald
		Degree 2: Colin O'Donoghue
		Degree 2: Brooke Smith
		Degree 2: Robin Wright
		Degree 2: John Ashton
		Degree 2: Chris Hemsworth
		Degree 2: Garrick Hagon
		Degree 2: Liam Neeson
		Degree 2: Ewen Bremner
		Degree 2: Nick Cannon
		Degree 2: Julian Fellowes
		Degree 2: Brian Geraghty
		Degree 2: Antony Starr
		Degree 2: Stuart Wilson
		Degree 2: Bruce Willis
		Degree 2: Matthew McConaughey
		Degree 2: Peter Vaughan
		Degree 2: Simon Merrells
		Degree 2: Naomi Watts
		Degree 2: Philip Seymour Hoffman
		Degree 2: Kevin Dunn
		Degree 2: Logan Lerman
		Degree 2: Toby Jones
		Degree 2: Natalie Portman
		Degree 2: James Frain
		Degree 2: Garcelle Beauvais
		Degree 2: Joan Allen
		Degree 2: Mika Boorem
		Degree 2: Emma Watson
		Degree 2: Scott Glenn
		Degree 2: Bob Hoskins
		Degree 2: Sebastian Roché
		Degree 2: Art Malik
		Degree 2: Tom Everett Scott
		Degree 2: Dane Cook
		Degree 2: Elisabeth Harnois
		Degree 2: Amy Poehler
		Degree 2: Michael Biehn
		Degree 2: Topher Grace
		Degree 2: Chelan Simmons
		Degree 2: Carlos Ponce
		Degree 2: Lisa Ann Walter
		Degree 2: Randy Quaid
		Degree 2: Radha Mitchell
		Degree 2: Andrew Wilson
		Degree 2: Alison Brie
		Degree 2: Heath Ledger
		Degree 2: Philip Baker Hall
		Degree 2: Reg E. Cathey
		Degree 2: Liam Neeson
		Degree 2: Reece Thompson
		Degree 2: Romany Malco
		Degree 2: Billy Burke
		Degree 2: Tom Cruise
		Degree 2: Alan Rickman
		Degree 2: Adam Scott
		Degree 2: Bruce Willis
		Degree 2: Steve Carell
		Degree 2: Kevin Dunn
		Degree 2: Rene Russo
		Degree 2: Kathleen Wilhoite
		Degree 2: Taylor Blackwell
		Degree 2: Jet Li
		Degree 2: Patti LuPone
		Degree 2: Clifton Collins Jr.
		Degree 2: Matthew Broderick
		Degree 2: Frances Fisher
		Degree 2: Bob Hoskins
		Degree 2: Willie Nelson
		Degree 2: Clint Eastwood
		Degree 2: Leleti Khumalo
		Degree 2: Christian Bale
		Degree 2: Noel Gugliemi
		Degree 2: Keanu Reeves
		Degree 2: Lynda Boyd
		Degree 2: Daniel Radcliffe
		Degree 2: Mike Colter
		Degree 2: Tatyana Ali
		Degree 2: Scarlett Johansson
		Degree 2: Jeffrey DeMunn
		Degree 2: Jaqueline Fleming
		Degree 2: Michael Roark
		Degree 2: Amr Waked
		Degree 2: Sanaa Lathan
		Degree 2: Minnie Driver
		Degree 2: Bob Gunton
		Degree 2: Jimmy Bennett
		Degree 2: Monica Potter
		Degree 2: Will Ferrell
		Degree 2: Zoë Bell
		Degree 2: Jon Favreau
		Degree 2: Romane Bohringer
		Degree 2: Pruitt Taylor Vince
		Degree 2: Bruce McGill
		Degree 2: Matthew McConaughey
		Degree 2: Bruce Davison
		Degree 2: Seth MacFarlane
		Degree 2: Tony Goldwyn
		Degree 2: Michael Wincott
		Degree 2: Michael O'Neill
		Degree 2: Camryn Manheim
		Degree 2: Dorian Missick
		Degree 2: Jessica Tandy
		Degree 2: Sofie Gråbøl
		Degree 2: Kevin Spacey
		Degree 2: Sean Hayes
		Degree 2: Harry Connick Jr.
		Degree 2: Matt Damon
		Degree 2: Matt Keeslar
		Degree 2: Ralph Ineson
		Degree 2: Peter McNamara
		Degree 2: Josh Hamilton
		Degree 2: Woody Allen
		Degree 2: Patrick Fischler
		Degree 2: Mekhi Phifer
		Degree 2: Kip Pardue
		Degree 2: Jon Seda
		Degree 2: Fiona Shaw
		Degree 2: Hayden Christensen
		Degree 2: Debbie Reynolds
		Degree 2: LL Cool J
		Degree 2: Denis O'Hare
		Degree 2: Wes Studi
		Degree 2: Bob Hoskins
		Degree 2: Perrey Reeves
		Degree 2: Salma Hayek
		Degree 2: Danny Webb
		Degree 2: Derek Jacobi
		Degree 2: Keanu Reeves
		Degree 2: Russell Tovey
		Degree 2: Richard Briers
		Degree 2: Julie Christie
		Degree 2: Jose Pablo Cantillo
		Degree 2: Ryan Gosling
		Degree 2: Ryan Reynolds
		Degree 2: Keanu Reeves
		Degree 2: Rosario Dawson
		Degree 2: Radha Mitchell
		Degree 2: Peter Gerety
		Degree 2: Penelope Wilton
		Degree 2: Viggo Mortensen
		Degree 2: Derek Luke
		Degree 2: Michael Rispoli
		Degree 2: Charlie Murphy
		Degree 2: Sanaa Lathan
		Degree 2: Kevin McNally
		Degree 2: Nadine Velazquez
		Degree 2: Tom Berenger
		Degree 2: Ricky Schroder
		Degree 2: RZA
		Degree 2: Milla Jovovich
		Degree 2: Sam Shepard
		Degree 2: Laura Harring
		Degree 2: Bruce Greenwood
		Degree 2: Chloë Grace Moretz
		Degree 2: Bruce Willis
		Degree 2: Mila Kunis
		Degree 2: Giancarlo Giannini
		Degree 2: Jurnee Smollett-Bell
		Degree 2: Patrick Fischler
		Degree 2: James Ransone
		Degree 2: Anne Heche
		Degree 2: Traci Lords
		Degree 2: Tom Hanks
		Degree 2: Tony Goldwyn
		Degree 2: Delroy Lindo
		Degree 2: Ruby Dee
		Degree 2: Mark Valley
		Degree 2: Dorian Missick
		Degree 2: John Billingsley
		Degree 2: Fred Ward
		Degree 2: Al Freeman Jr.
		Degree 2: Vincent Pastore
		Degree 2: Snoop Dogg
		Degree 2: Kevin Connolly
		Degree 2: James Wilcox
		Degree 2: Nicholas Turturro
		Degree 2: Scott Glenn
		Degree 2: Deborah Kara Unger
		Degree 2: Matthew Broderick
		Degree 2: Matt Damon
		Degree 2: Costas Mandylor
		Degree 2: Ramon Rodriguez
		Degree 2: Jason Robards
		Degree 2: Julia Roberts
		Degree 2: Ethan Suplee
		Degree 2: John Heard
		Degree 2: Joanna Lumley
		Degree 2: Dianne Wiest
		Degree 2: Christian Bale
		Degree 2: Kate Winslet
		Degree 2: Stephen Graham
		Degree 2: Bill Murray
		Degree 2: Michael Parks
		Degree 2: Benedict Cumberbatch
		Degree 2: Ellen Barkin
		Degree 2: David Kelly
		Degree 2: Meryl Streep
		Degree 2: Charlize Theron
		Degree 2: Anna Kendrick
		Degree 2: Lena Olin
		Degree 2: Ray Winstone
		Degree 2: Timothy Hutton
		Degree 2: Leonardo DiCaprio
		Degree 2: Lin Shaye
		Degree 2: Ruth Wilson
		Degree 2: Tom Wilkinson
		Degree 2: Stephen Root
		Degree 2: Salma Hayek
		Degree 2: Tom Berenger
		Degree 2: Frank Langella
		Degree 2: Olivia Munn
		Degree 2: Conchata Ferrell
		Degree 2: Martin Landau
		Degree 2: Haley Joel Osment
		Degree 2: Marlon Brando
		Degree 2: Orlando Bloom
		Degree 2: Alan Rickman
		Degree 2: Yaphet Kotto
		Degree 2: Enrique Iglesias
		Degree 2: Chloë Grace Moretz
		Degree 2: Faye Dunaway
		Degree 2: Adam Scott
		Degree 2: Jack Davenport
		Degree 2: Tom Arnold
		Degree 2: Amanda Wyss
		Degree 2: Charles S. Dutton
		Degree 2: Anne Heche
		Degree 2: Anne Hathaway
		Degree 2: Christopher Lee
		Degree 2: Kelly Macdonald
		Degree 2: Jordi Mollà
		Degree 2: Clifton Collins Jr.
		Degree 2: Michael Jeter
		Degree 2: Sam Claflin
		Degree 2: Jason Flemyng
		Degree 2: Ian Richardson
		Degree 2: Al Pacino
		Degree 2: Kevin Dillon
		Degree 2: Ulrich Thomsen
		Degree 2: Kevin Tighe
		Degree 2: Ethan Suplee
		Degree 2: Scoot McNairy
		Degree 2: Ryan Gosling
		Degree 2: Tate Donovan
		Degree 2: Kieran Culkin
		Degree 2: Charlize Theron
		Degree 2: Salma Hayek
		Degree 2: Ted Raimi
		Degree 2: Eddie Cibrian
		Degree 2: Jake Busey
		Degree 2: Jordana Brewster
		Degree 2: Jason Statham
		Degree 2: Natasha Henstridge
		Degree 2: Paul Walker
		Degree 2: Natasha Lyonne
		Degree 2: Eddie Spears
		Degree 2: Sarah Michelle Gellar
		Degree 2: Rebecca De Mornay
		Degree 2: Harrison Ford
		Degree 2: Elliott Gould
		Degree 2: Julia Ormond
		Degree 2: Mako
		Degree 2: Michael Fassbender
		Degree 2: Tye Sheridan
		Degree 2: Goran Visnjic
		Degree 2: Eugenie Bondurant
		Degree 2: Robin Williams
		Degree 2: Mireille Enos
		Degree 2: Meat Loaf
		Degree 2: Robin Wright
		Degree 2: Reg E. Cathey
		Degree 2: Minnie Driver
		Degree 2: Fiona Shaw
		Degree 2: Bernie Mac
		Degree 2: Julia Roberts
		Degree 2: Will Ferrell
		Degree 2: Catherine McCormack
		Degree 2: Peter Capaldi
		Degree 2: Adriano Giannini
		Degree 2: Kirsten Dunst
		Degree 2: Sam Shepard
		Degree 2: Orlando Bloom
		Degree 2: Jeremy Renner
		Degree 2: Christoph Waltz
		Degree 2: Tom Cruise
		Degree 2: Mini Anden
		Degree 2: Michael Rapaport
		Degree 2: Natascha McElhone
		Degree 2: Julian Glover
		Degree 2: Philip Seymour Hoffman
		Degree 2: Victor Wong
		Degree 2: Logan Lerman
		Degree 2: Jim Parrack
		Degree 2: Dermot Crowley
		Degree 2: Ben Mendelsohn
		Degree 2: Jason Flemyng
		Degree 2: Al Pacino
		Degree 2: Jason Statham
		Degree 2: Matt Damon
		Degree 2: Kevin Sussman
		Degree 2: Harriet Walter
		Degree 2: Timothy West
		Degree 2: Stephen Dillane
		Degree 2: Armin Mueller-Stahl
		Degree 2: Nicholas Bell
		Degree 2: Danny Huston
		Degree 2: Ivana Milicevic
		Degree 2: Ray Winstone
		Degree 2: Tom Cruise
		Degree 2: Lara Pulver
		Degree 2: Audrey Fleurot
		Degree 2: Tia Carrere
		Degree 2: Nina Arianda
		Degree 2: Michael McKean
		Degree 2: Ellen Barkin
		Degree 2: Lara Flynn Boyle
		Degree 2: Ed Begley Jr.
		Degree 2: James Karen
		Degree 2: Will Smith
		Degree 2: Alan Dale
		Degree 2: Bailee Madison
		Degree 2: Christian Bale
		Degree 2: Noel Gugliemi
		Degree 2: Bill Nunn
		Degree 2: Kate Winslet
		Degree 2: Jane Curtin
		Degree 2: Rainn Wilson
		Degree 2: Lukas Haas
		Degree 2: Brooke Smith
		Degree 2: Viggo Mortensen
		Degree 2: Sophie Okonedo
		Degree 2: Meryl Streep
		Degree 2: Amy Sedaris
		Degree 2: Sam Trammell
		Degree 2: Todd Louiso
		Degree 2: Anna Kendrick
		Degree 2: Matt Smith
		Degree 2: Melissa Benoist
		Degree 2: Stephen Root
		Degree 2: Kirsten Dunst
		Degree 2: Will Ferrell
		Degree 2: Carmine Giovinazzo
		Degree 2: Jon Favreau
		Degree 2: Frances Conroy
		Degree 2: Emilia Clarke
		Degree 2: Bruce Willis
		Degree 2: Mila Kunis
		Degree 2: Chris Lowell
		Degree 2: Peter Mensah
		Degree 2: David O'Hara
		Degree 2: Bobby Coleman
		Degree 2: Chris Mulkey
		Degree 2: Bradley Cooper
		Degree 2: Tom Hanks
		Degree 2: Olivia Wilde
		Degree 2: Elaine Stritch
		Degree 2: Paul Guilfoyle
		Degree 2: James Franco
		Degree 2: Cynthia Stevenson
		Degree 2: Cameron Bright
		Degree 2: Clifton Collins Jr.
		Degree 2: Harry Connick Jr.
		Degree 2: Virginia Madsen
		Degree 2: Zach Gilford
		Degree 2: Jennifer Garner
		Degree 2: Bruce Dern
		Degree 2: Kevin Sussman
		Degree 2: Kelly Preston
		Degree 2: Jake Gyllenhaal
		Degree 2: Julia Roberts
		Degree 2: Danny Huston
		Degree 2: Donald Sumpter
		Degree 2: Jimi Mistry
		Degree 2: Om Puri
		Degree 2: Anupam Kher
		Degree 2: Albert Finney
		Degree 2: Parminder Nagra
		Degree 2: Richard Coyle
		Degree 2: Ioan Gruffudd
		Degree 2: Dwayne Johnson
		Degree 2: Alexandra Maria Lara
		Degree 2: Matt Smith
		Degree 2: Bella Heathcote
		Degree 2: Samantha Morton
		Degree 2: Jimmy Jean-Louis
		Degree 2: Christian Bale
		Degree 2: Vincent Regan
		Degree 2: Michael Fassbender
		Degree 2: Radha Mitchell
		Degree 2: Ethan Embry
		Degree 2: Alison Lohman
		Degree 2: Abigail Spencer
		Degree 2: Minnie Driver
		Degree 2: Jeri Ryan
		Degree 2: Tom Wilkinson
		Degree 2: Miranda Richardson
		Degree 2: Bryan Brown
		Degree 2: Peter Greene
		Degree 2: Nellie McKay
		Degree 2: Madeline Carroll
		Degree 2: Anthony Simcoe
		Degree 2: Craig Ferguson
		Degree 2: Paul Walker
		Degree 2: Leslie Bibb
		Degree 2: Eric Winter
		Degree 2: Matthew McConaughey
		Degree 2: Leven Rambin
		Degree 2: Dennis Quaid
		Degree 2: Logan Lerman
		Degree 2: America Ferrera
		Degree 2: Dorian Missick
		Degree 2: John Michael Higgins
		Degree 2: Harry Connick Jr.
		Degree 2: Elodie Yung
		Degree 2: Judy Greer
		Degree 2: Christopher James Baker
		Degree 2: Danny Masterson
		Degree 2: Tom Hardy
		Degree 2: Costas Mandylor
		Degree 2: Julian Kostov
		Degree 2: Kathy Baker
		Degree 2: Boyd Holbrook
		Degree 2: Natascha McElhone
		Degree 2: Zoe Levin
		Degree 2: Kate Winslet
		Degree 2: Jordan Trovillion
		Degree 2: Jane Adams
		Degree 2: Kenneth Mitchell
		Degree 2: Peter Krause
		Degree 2: Roger Willie
		Degree 2: Meat Loaf
		Degree 2: Dennis Quaid
		Degree 2: Elizabeth Perkins
		Degree 2: Eddie Cahill
		Degree 2: Natalie Portman
		Degree 2: Sean Connery
		Degree 2: José Wilker
In [ ]: