import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
pd.options.display.max_columns = 25
pd.options.display.float_format = '{:.2f}'.format
## Read the csv file; change date col as release_date
df = pd.read_csv("movies_complete.csv", parse_dates= ["release_date"])
## Observe the columns of database
df.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 44691 entries, 0 to 44690 Data columns (total 22 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 id 44691 non-null int64 1 title 44691 non-null object 2 tagline 20284 non-null object 3 release_date 44657 non-null datetime64[ns] 4 genres 42586 non-null object 5 belongs_to_collection 4463 non-null object 6 original_language 44681 non-null object 7 budget_musd 8854 non-null float64 8 revenue_musd 7385 non-null float64 9 production_companies 33356 non-null object 10 production_countries 38835 non-null object 11 vote_count 44691 non-null float64 12 vote_average 42077 non-null float64 13 popularity 44691 non-null float64 14 runtime 43179 non-null float64 15 overview 43740 non-null object 16 spoken_languages 41094 non-null object 17 poster_path 44467 non-null object 18 cast 42502 non-null object 19 cast_size 44691 non-null int64 20 crew_size 44691 non-null int64 21 director 43960 non-null object dtypes: datetime64[ns](1), float64(6), int64(3), object(12) memory usage: 7.5+ MB
df.head(5)
id | title | tagline | release_date | genres | belongs_to_collection | original_language | budget_musd | revenue_musd | production_companies | production_countries | vote_count | vote_average | popularity | runtime | overview | spoken_languages | poster_path | cast | cast_size | crew_size | director | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 862 | Toy Story | NaN | 1995-10-30 | Animation|Comedy|Family | Toy Story Collection | en | 30.00 | 373.55 | Pixar Animation Studios | United States of America | 5415.00 | 7.70 | 21.95 | 81.00 | Led by Woody, Andy's toys live happily in his ... | English | <img src='http://image.tmdb.org/t/p/w185//uXDf... | Tom Hanks|Tim Allen|Don Rickles|Jim Varney|Wal... | 13 | 106 | John Lasseter |
1 | 8844 | Jumanji | Roll the dice and unleash the excitement! | 1995-12-15 | Adventure|Fantasy|Family | NaN | en | 65.00 | 262.80 | TriStar Pictures|Teitler Film|Interscope Commu... | United States of America | 2413.00 | 6.90 | 17.02 | 104.00 | When siblings Judy and Peter discover an encha... | English|Français | <img src='http://image.tmdb.org/t/p/w185//vgpX... | Robin Williams|Jonathan Hyde|Kirsten Dunst|Bra... | 26 | 16 | Joe Johnston |
2 | 15602 | Grumpier Old Men | Still Yelling. Still Fighting. Still Ready for... | 1995-12-22 | Romance|Comedy | Grumpy Old Men Collection | en | nan | nan | Warner Bros.|Lancaster Gate | United States of America | 92.00 | 6.50 | 11.71 | 101.00 | A family wedding reignites the ancient feud be... | English | <img src='http://image.tmdb.org/t/p/w185//1FSX... | Walter Matthau|Jack Lemmon|Ann-Margret|Sophia ... | 7 | 4 | Howard Deutch |
3 | 31357 | Waiting to Exhale | Friends are the people who let you be yourself... | 1995-12-22 | Comedy|Drama|Romance | NaN | en | 16.00 | 81.45 | Twentieth Century Fox Film Corporation | United States of America | 34.00 | 6.10 | 3.86 | 127.00 | Cheated on, mistreated and stepped on, the wom... | English | <img src='http://image.tmdb.org/t/p/w185//4wjG... | Whitney Houston|Angela Bassett|Loretta Devine|... | 10 | 10 | Forest Whitaker |
4 | 11862 | Father of the Bride Part II | Just When His World Is Back To Normal... He's ... | 1995-02-10 | Comedy | Father of the Bride Collection | en | nan | 76.58 | Sandollar Productions|Touchstone Pictures | United States of America | 173.00 | 5.70 | 8.39 | 106.00 | Just when George Banks has recovered from his ... | English | <img src='http://image.tmdb.org/t/p/w185//lf9R... | Steve Martin|Diane Keaton|Martin Short|Kimberl... | 12 | 7 | Charles Shyer |
Features:
## Statistical representation of the dataset
df.describe()
id | budget_musd | revenue_musd | vote_count | vote_average | popularity | runtime | cast_size | crew_size | |
---|---|---|---|---|---|---|---|---|---|
count | 44691.00 | 8854.00 | 7385.00 | 44691.00 | 42077.00 | 44691.00 | 43179.00 | 44691.00 | 44691.00 |
mean | 107186.24 | 21.67 | 68.97 | 111.65 | 6.00 | 2.96 | 97.57 | 12.48 | 10.31 |
std | 111806.36 | 34.36 | 146.61 | 495.32 | 1.28 | 6.04 | 34.65 | 12.12 | 15.89 |
min | 2.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 1.00 | 0.00 | 0.00 |
25% | 26033.50 | 2.00 | 2.41 | 3.00 | 5.30 | 0.40 | 86.00 | 6.00 | 2.00 |
50% | 59110.00 | 8.20 | 16.87 | 10.00 | 6.10 | 1.15 | 95.00 | 10.00 | 6.00 |
75% | 154251.00 | 25.00 | 67.64 | 35.00 | 6.80 | 3.77 | 107.00 | 15.00 | 12.00 |
max | 469172.00 | 380.00 | 2787.97 | 14075.00 | 10.00 | 547.49 | 1256.00 | 313.00 | 435.00 |
## Which movies-genres has highest reviews
ratings = df.groupby(['id', 'genres'], as_index=False)['vote_average'].aggregate(np.mean)
ratings.head()
id | genres | vote_average | |
---|---|---|---|
0 | 2 | Drama|Crime | 7.10 |
1 | 3 | Drama|Comedy | 7.10 |
2 | 5 | Crime|Comedy | 6.50 |
3 | 6 | Action|Thriller|Crime | 6.40 |
4 | 11 | Adventure|Action|Science Fiction | 8.10 |
## How many have highest runtime over the period?
import seaborn as sns
sns.distplot(df[(df['runtime'] <300) & (df['runtime']>0)]['runtime'])
<matplotlib.axes._subplots.AxesSubplot at 0x125f36b7188>
## How many movies in years have been released?
released = df.groupby('release_date')['title'].count()
released.plot(figsize=(20,8))
<matplotlib.axes._subplots.AxesSubplot at 0x12581733a08>
## Arrange best 50 movies in descending order of profit then return
df_best.head(50).sort_values(['profit_musd','return'],ascending = False)
poster_path | title | budget_musd | revenue_musd | vote_count | vote_average | popularity | profit_musd | return | |
---|---|---|---|---|---|---|---|---|---|
0 | <img src='http://image.tmdb.org/t/p/w185//uXDf... | Toy Story | 30.00 | 373.55 | 5415.00 | 7.70 | 21.95 | 343.55 | 12.45 |
46 | <img src='http://image.tmdb.org/t/p/w185//GQP6... | Se7en | 33.00 | 327.31 | 5915.00 | 8.10 | 18.46 | 294.31 | 9.92 |
9 | <img src='http://image.tmdb.org/t/p/w185//z0lj... | GoldenEye | 58.00 | 352.19 | 1194.00 | 6.60 | 14.69 | 294.19 | 6.07 |
47 | <img src='http://image.tmdb.org/t/p/w185//kZ1f... | Pocahontas | 55.00 | 346.08 | 1509.00 | 6.70 | 13.28 | 291.08 | 6.29 |
33 | <img src='http://image.tmdb.org/t/p/w185//kf34... | Babe | 30.00 | 254.13 | 756.00 | 6.00 | 14.40 | 224.13 | 8.47 |
1 | <img src='http://image.tmdb.org/t/p/w185//vgpX... | Jumanji | 65.00 | 262.80 | 2413.00 | 6.90 | 17.02 | 197.80 | 4.04 |
18 | <img src='http://image.tmdb.org/t/p/w185//wcin... | Ace Ventura: When Nature Calls | 30.00 | 212.39 | 1128.00 | 6.10 | 8.21 | 182.39 | 7.08 |
31 | <img src='http://image.tmdb.org/t/p/w185//2F9K... | Twelve Monkeys | 29.50 | 168.84 | 2470.00 | 7.40 | 12.30 | 139.34 | 5.72 |
5 | <img src='http://image.tmdb.org/t/p/w185//lbf2... | Heat | 60.00 | 187.44 | 1886.00 | 7.70 | 17.92 | 127.44 | 3.12 |
16 | <img src='http://image.tmdb.org/t/p/w185//1ryN... | Sense and Sensibility | 16.50 | 135.00 | 364.00 | 7.20 | 10.67 | 118.50 | 8.18 |
43 | <img src='http://image.tmdb.org/t/p/w185//eUdh... | Mortal Kombat | 18.00 | 122.20 | 452.00 | 5.40 | 10.87 | 104.20 | 6.79 |
20 | <img src='http://image.tmdb.org/t/p/w185//enHk... | Get Shorty | 30.25 | 115.10 | 305.00 | 6.40 | 12.67 | 84.85 | 3.81 |
3 | <img src='http://image.tmdb.org/t/p/w185//4wjG... | Waiting to Exhale | 16.00 | 81.45 | 34.00 | 6.10 | 3.86 | 65.45 | 5.09 |
15 | <img src='http://image.tmdb.org/t/p/w185//13jm... | Casino | 52.00 | 116.11 | 1343.00 | 7.80 | 10.14 | 64.11 | 2.23 |
24 | <img src='http://image.tmdb.org/t/p/w185//rl5R... | Leaving Las Vegas | 3.60 | 49.80 | 365.00 | 7.10 | 10.33 | 46.20 | 13.83 |
10 | <img src='http://image.tmdb.org/t/p/w185//yObO... | The American President | 62.00 | 107.88 | 199.00 | 6.50 | 6.32 | 45.88 | 1.74 |
8 | <img src='http://image.tmdb.org/t/p/w185//gV1V... | Sudden Death | 35.00 | 64.35 | 174.00 | 5.50 | 5.23 | 29.35 | 1.84 |
35 | <img src='http://image.tmdb.org/t/p/w185//njn4... | Dead Man Walking | 11.00 | 39.36 | 350.00 | 7.30 | 6.89 | 28.36 | 3.58 |
49 | <img src='http://image.tmdb.org/t/p/w185//6Dr8... | The Usual Suspects | 6.00 | 23.34 | 3334.00 | 8.10 | 16.30 | 17.34 | 3.89 |
26 | <img src='http://image.tmdb.org/t/p/w185//yQ8x... | Now and Then | 12.00 | 27.40 | 91.00 | 6.60 | 8.68 | 15.40 | 2.28 |
45 | <img src='http://image.tmdb.org/t/p/w185//kFVx... | How To Make An American Quilt | 10.00 | 23.57 | 38.00 | 6.50 | 4.49 | 13.57 | 2.36 |
44 | <img src='http://image.tmdb.org/t/p/w185//aedh... | To Die For | 20.00 | 21.28 | 177.00 | 6.70 | 10.45 | 1.28 | 1.06 |
17 | <img src='http://image.tmdb.org/t/p/w185//xhU6... | Four Rooms | 4.00 | 4.30 | 539.00 | 6.50 | 9.03 | 0.30 | 1.07 |
28 | <img src='http://image.tmdb.org/t/p/w185//zIIW... | The City of Lost Children | 18.00 | 1.74 | 308.00 | 7.60 | 9.82 | -16.26 | 0.10 |
22 | <img src='http://image.tmdb.org/t/p/w185//9LaH... | Assassins | 50.00 | 30.30 | 394.00 | 6.00 | 11.07 | -19.70 | 0.61 |
19 | <img src='http://image.tmdb.org/t/p/w185//jWBD... | Money Train | 60.00 | 35.43 | 224.00 | 5.40 | 7.34 | -24.57 | 0.59 |
13 | <img src='http://image.tmdb.org/t/p/w185//yzMS... | Nixon | 44.00 | 13.68 | 72.00 | 7.10 | 5.09 | -30.32 | 0.31 |
14 | <img src='http://image.tmdb.org/t/p/w185//hYde... | Cutthroat Island | 98.00 | 10.02 | 137.00 | 5.70 | 7.28 | -87.98 | 0.10 |
2 | <img src='http://image.tmdb.org/t/p/w185//1FSX... | Grumpier Old Men | nan | nan | 92.00 | 6.50 | 11.71 | nan | nan |
4 | <img src='http://image.tmdb.org/t/p/w185//lf9R... | Father of the Bride Part II | nan | 76.58 | 173.00 | 5.70 | 8.39 | nan | nan |
6 | <img src='http://image.tmdb.org/t/p/w185//z1oN... | Sabrina | 58.00 | nan | 141.00 | 6.20 | 6.68 | nan | nan |
7 | <img src='http://image.tmdb.org/t/p/w185//6yox... | Tom and Huck | nan | nan | 45.00 | 5.40 | 2.56 | nan | nan |
11 | <img src='http://image.tmdb.org/t/p/w185//4rRf... | Dracula: Dead and Loving It | nan | nan | 210.00 | 5.70 | 5.43 | nan | nan |
12 | <img src='http://image.tmdb.org/t/p/w185//tpoa... | Balto | nan | 11.35 | 423.00 | 7.10 | 12.14 | nan | nan |
21 | <img src='http://image.tmdb.org/t/p/w185//fdYw... | Copycat | nan | nan | 199.00 | 6.50 | 10.70 | nan | nan |
23 | <img src='http://image.tmdb.org/t/p/w185//kImK... | Powder | nan | nan | 143.00 | 6.30 | 12.13 | nan | nan |
25 | <img src='http://image.tmdb.org/t/p/w185//6u14... | Othello | nan | nan | 33.00 | 7.00 | 1.85 | nan | nan |
27 | <img src='http://image.tmdb.org/t/p/w185//tYOF... | Persuasion | nan | nan | 36.00 | 7.40 | 2.23 | nan | nan |
29 | <img src='http://image.tmdb.org/t/p/w185//x6SZ... | Shanghai Triad | nan | nan | 17.00 | 6.50 | 1.10 | nan | nan |
30 | <img src='http://image.tmdb.org/t/p/w185//vzAm... | Dangerous Minds | nan | 180.00 | 249.00 | 6.40 | 9.48 | nan | nan |
32 | <img src='http://image.tmdb.org/t/p/w185//hSfI... | Wings of Courage | nan | nan | 4.00 | 6.80 | 0.75 | nan | nan |
34 | <img src='http://image.tmdb.org/t/p/w185//8Nme... | Carrington | nan | nan | 16.00 | 6.40 | 1.49 | nan | nan |
36 | <img src='http://image.tmdb.org/t/p/w185//lKOA... | Across the Sea of Time | nan | nan | 2.00 | 3.50 | 0.11 | nan | nan |
37 | <img src='http://image.tmdb.org/t/p/w185//sdes... | It Takes Two | nan | nan | 149.00 | 6.10 | 7.78 | nan | nan |
38 | <img src='http://image.tmdb.org/t/p/w185//8AwV... | Clueless | 12.00 | nan | 828.00 | 6.90 | 9.88 | nan | nan |
39 | <img src='http://image.tmdb.org/t/p/w185//kGPs... | Cry, the Beloved Country | nan | 0.68 | 13.00 | 6.70 | 0.89 | nan | nan |
40 | <img src='http://image.tmdb.org/t/p/w185//aN2B... | Richard III | nan | nan | 50.00 | 6.90 | 4.56 | nan | nan |
41 | <img src='http://image.tmdb.org/t/p/w185//gCqf... | Dead Presidents | 10.00 | nan | 80.00 | 6.60 | 9.88 | nan | nan |
42 | <img src='http://image.tmdb.org/t/p/w185//wkf0... | Restoration | 19.00 | nan | 30.00 | 6.30 | 10.98 | nan | nan |
48 | <img src='http://image.tmdb.org/t/p/w185//f9ed... | When Night Is Falling | nan | nan | 10.00 | 5.90 | 3.30 | nan | nan |
## Top 5 movies HTML Link and Title
top_5 = df_best.iloc[:5, :2]
top_5
poster_path | title | |
---|---|---|
0 | <img src='http://image.tmdb.org/t/p/w185//uXDf... | Toy Story |
1 | <img src='http://image.tmdb.org/t/p/w185//vgpX... | Jumanji |
2 | <img src='http://image.tmdb.org/t/p/w185//1FSX... | Grumpier Old Men |
3 | <img src='http://image.tmdb.org/t/p/w185//4wjG... | Waiting to Exhale |
4 | <img src='http://image.tmdb.org/t/p/w185//lf9R... | Father of the Bride Part II |
HTML(top_5.to_html(escape=False))
poster_path | title | |
---|---|---|
0 | ![]() |
Toy Story |
1 | ![]() |
Jumanji |
2 | ![]() |
Grumpier Old Men |
3 | ![]() |
Waiting to Exhale |
4 | ![]() |
Father of the Bride Part II |
## High budget movies with high rate of return and high profits
df_best.loc[df_best.budget_musd >= 300].sort_values(by = "return", ascending = False)
poster_path | title | budget_musd | revenue_musd | vote_count | vote_average | popularity | profit_musd | return | |
---|---|---|---|---|---|---|---|---|---|
11743 | <img src='http://image.tmdb.org/t/p/w185//oVh3... | Pirates of the Caribbean: At World's End | 300.00 | 961.00 | 4627.00 | 6.90 | 31.36 | 661.00 | 3.20 |
16986 | <img src='http://image.tmdb.org/t/p/w185//keGf... | Pirates of the Caribbean: On Stranger Tides | 380.00 | 1045.71 | 5068.00 | 6.40 | 27.89 | 665.71 | 2.75 |
HTML(bruce.to_html(escape=False))
poster_path | vote_average | |
---|---|---|
title | ||
The Fifth Element | ![]() |
7.30 |
Looper | ![]() |
6.60 |
Armageddon | ![]() |
6.50 |
Surrogates | ![]() |
5.90 |
G.I. Joe: Retaliation | ![]() |
5.40 |
Vice | ![]() |
4.10 |
HTML(pixar.head(5).to_html(escape=False))
poster_path | revenue_musd | release_date | |
---|---|---|---|
title | |||
Toy Story 3 | ![]() |
1066.97 | 2010-06-16 |
Inside Out | ![]() |
857.61 | 2015-06-09 |
Monsters University | ![]() |
743.56 | 2013-06-20 |
Cars 2 | ![]() |
559.85 | 2011-06-11 |
Brave | ![]() |
538.98 | 2012-06-21 |
HTML(next_mov.to_html(escape=False))
poster_path | genres | vote_average | vote_count | release_date | |
---|---|---|---|---|---|
title | |||||
Descendants 2 | ![]() |
TV Movie|Family|Action|Comedy|Music|Adventure | 7.50 | 171.00 | 2017-07-21 |
Dunkirk | ![]() |
Action|Drama|History|Thriller|War | 7.50 | 2712.00 | 2017-07-19 |
The Book of Henry | ![]() |
Thriller|Drama|Crime | 7.60 | 84.00 | 2017-06-16 |
Guardians of the Galaxy Vol. 2 | ![]() |
Action|Adventure|Comedy|Science Fiction | 7.60 | 4858.00 | 2017-04-19 |
Logan | ![]() |
Action|Drama|Science Fiction | 7.60 | 6310.00 | 2017-02-28 |
The Thinning | ![]() |
Thriller | 7.60 | 92.00 | 2016-10-12 |
11.22.63 | ![]() |
Drama|History|Thriller | 8.00 | 213.00 | 2016-02-15 |
Star Wars: The Force Awakens | ![]() |
Action|Adventure|Science Fiction|Fantasy | 7.50 | 7993.00 | 2015-12-15 |
London Spy | ![]() |
Romance|Crime|Drama|Mystery|Thriller | 8.80 | 12.00 | 2015-11-09 |
Spotlight | ![]() |
Drama|Thriller|History | 7.80 | 2751.00 | 2015-11-06 |
Room | ![]() |
Drama|Thriller | 8.10 | 2838.00 | 2015-10-16 |
The Fear of 13 | ![]() |
Thriller|Documentary | 8.00 | 45.00 | 2015-10-15 |
3 ½ Minutes, 10 Bullets | ![]() |
Thriller|Documentary | 7.80 | 30.00 | 2015-10-02 |
An Inspector Calls | ![]() |
Drama|Crime|Thriller | 7.60 | 42.00 | 2015-09-13 |
Kung Fury | ![]() |
Action|Comedy|Science Fiction|Fantasy | 7.60 | 762.00 | 2015-05-22 |
Kingsman: The Secret Service | ![]() |
Crime|Comedy|Action|Adventure | 7.60 | 6069.00 | 2015-01-29 |
Black Mirror: White Christmas | ![]() |
Drama|Horror|Mystery|Science Fiction|Thriller|TV Movie | 8.30 | 211.00 | 2014-12-16 |
The Imitation Game | ![]() |
History|Drama|Thriller|War | 8.00 | 5895.00 | 2014-11-14 |
Big Hero 6 | ![]() |
Adventure|Family|Animation|Action|Comedy | 7.80 | 6289.00 | 2014-10-24 |
Nightcrawler | ![]() |
Crime|Drama|Thriller | 7.60 | 3475.00 | 2014-10-23 |
franchises[franchises[("vote_count", "mean")] >=1000].nlargest(20, ("vote_average", "mean"))
title | budget_musd | revenue_musd | vote_average | popularity | ROI | vote_count | |||
---|---|---|---|---|---|---|---|---|---|
count | sum | mean | sum | mean | mean | mean | median | mean | |
belongs_to_collection | |||||||||
The Lord of the Rings Collection | 3 | 266.00 | 88.67 | 2916.54 | 972.18 | 8.03 | 30.27 | 11.73 | 8253.00 |
The Godfather Collection | 3 | 73.00 | 24.33 | 429.38 | 143.13 | 7.97 | 31.64 | 3.66 | 3677.00 |
Blade Runner Collection | 1 | 28.00 | 28.00 | 33.14 | 33.14 | 7.90 | 96.27 | 1.18 | 3833.00 |
The Man With No Name Collection | 3 | 2.00 | 0.67 | 35.50 | 11.83 | 7.83 | 14.17 | 25.00 | 1422.67 |
The Dark Knight Collection | 3 | 585.00 | 195.00 | 2463.72 | 821.24 | 7.80 | 57.42 | 4.34 | 9681.00 |
Guardians of the Galaxy Collection | 2 | 370.00 | 185.00 | 1636.74 | 818.37 | 7.75 | 119.31 | 4.43 | 7436.00 |
Kill Bill Collection | 2 | 60.00 | 30.00 | 333.11 | 166.55 | 7.70 | 23.40 | 5.55 | 4576.00 |
Kingsman Collection | 1 | 81.00 | 81.00 | 414.35 | 414.35 | 7.60 | 28.22 | 5.12 | 6069.00 |
How to Train Your Dragon Collection | 2 | 310.00 | 155.00 | 1104.00 | 552.00 | 7.55 | 13.34 | 3.60 | 3741.00 |
Harry Potter Collection | 8 | 1280.00 | 160.00 | 7707.37 | 963.42 | 7.54 | 26.25 | 6.17 | 5983.25 |
Toy Story Collection | 3 | 320.00 | 106.67 | 1937.89 | 645.96 | 7.53 | 18.82 | 5.53 | 4679.67 |
Back to the Future Collection | 3 | 99.00 | 33.00 | 957.64 | 319.21 | 7.50 | 17.50 | 8.30 | 4381.00 |
Trainspotting Collection | 2 | 22.00 | 11.00 | 57.90 | 28.95 | 7.45 | 18.50 | 3.21 | 1766.00 |
Deadpool Collection | 1 | 58.00 | 58.00 | 783.11 | 783.11 | 7.40 | 187.86 | 13.50 | 11444.00 |
The Incredibles Collection | 1 | 92.00 | 92.00 | 631.44 | 631.44 | 7.40 | 22.22 | 6.86 | 5290.00 |
Star Wars Collection | 8 | 854.35 | 106.79 | 7434.49 | 929.31 | 7.37 | 23.41 | 8.24 | 5430.38 |
The Avengers Collection | 2 | 500.00 | 250.00 | 2924.96 | 1462.48 | 7.35 | 63.63 | 5.96 | 9454.00 |
The Lego Movie Collection | 2 | 140.00 | 70.00 | 781.11 | 390.56 | 7.35 | 16.74 | 5.86 | 2300.00 |
Tangled Collection | 2 | 260.00 | 260.00 | 591.79 | 591.79 | 7.25 | 12.32 | 2.28 | 1901.00 |
The Space Odyssey Series | 2 | 38.50 | 19.25 | 109.10 | 54.55 | 7.25 | 14.99 | 3.99 | 1682.50 |
plt.figure(figsize = (12, 8))
df.director.value_counts().head(20).plot(kind='bar', fontsize = 15)
plt.title("Most Active Directors",fontsize = 20)
plt.ylabel("Number of Movies", fontsize = 15)
plt.show()
plt.figure(figsize = (12, 8))
df.groupby("director").revenue_musd.sum().nlargest(20).plot(kind='bar', fontsize = 15)
plt.title("Total Revenue",fontsize = 20)
plt.ylabel("Revenue (in MUSD)", fontsize = 15)
plt.show()
act.columns = ["Actor"]
act = act.merge(df[["title", "revenue_musd", "vote_average", "popularity"]],
how = "left", left_index = True, right_index = True)
act.Actor.value_counts().head(20)
Bess Flowers 240 Christopher Lee 148 John Wayne 125 Samuel L. Jackson 122 Michael Caine 110 John Carradine 109 Gérard Depardieu 109 Donald Sutherland 108 Jackie Chan 108 Frank Welker 107 Robert De Niro 104 Steve Buscemi 101 Danny Trejo 101 Irving Bacon 98 John Goodman 97 Christopher Walken 96 Danny Glover 95 John Hurt 93 Susan Sarandon 92 Dennis Hopper 92 Name: Actor, dtype: int64
plt.figure(figsize = (12, 8))
act.Actor.value_counts().head(20).plot(kind='bar', fontsize = 15)
plt.title("Most Active Actors",fontsize = 20)
plt.ylabel("Number of Movies", fontsize = 15)
plt.show()
agg.nlargest(10, "Total_Movies")
Total_Revenue | Mean_Revenue | Mean_Rating | Mean_Pop | Total_Movies | |
---|---|---|---|---|---|
Actor | |||||
Bess Flowers | 368.91 | 14.76 | 6.18 | 2.03 | 240 |
Christopher Lee | 9417.05 | 324.73 | 5.91 | 4.75 | 148 |
John Wayne | 236.09 | 11.24 | 5.71 | 3.09 | 125 |
Samuel L. Jackson | 17109.62 | 213.87 | 6.27 | 11.70 | 122 |
Michael Caine | 8053.40 | 191.75 | 6.27 | 8.27 | 110 |
Gérard Depardieu | 1247.61 | 95.97 | 6.05 | 3.70 | 109 |
John Carradine | 255.84 | 19.68 | 5.55 | 2.43 | 109 |
Donald Sutherland | 5390.77 | 138.22 | 6.23 | 7.00 | 108 |
Jackie Chan | 4699.19 | 146.85 | 6.28 | 5.86 | 108 |
Frank Welker | 13044.15 | 326.10 | 6.31 | 9.57 | 107 |
agg.nlargest(10, "Total_Revenue")
Total_Revenue | Mean_Revenue | Mean_Rating | Mean_Pop | Total_Movies | |
---|---|---|---|---|---|
Actor | |||||
Stan Lee | 19414.96 | 647.17 | 6.51 | 29.94 | 48 |
Samuel L. Jackson | 17109.62 | 213.87 | 6.27 | 11.70 | 122 |
Warwick Davis | 13256.03 | 662.80 | 6.29 | 13.09 | 34 |
Frank Welker | 13044.15 | 326.10 | 6.31 | 9.57 | 107 |
John Ratzenberger | 12596.13 | 449.86 | 6.48 | 10.96 | 46 |
Jess Harnell | 12234.61 | 611.73 | 6.44 | 10.92 | 35 |
Hugo Weaving | 11027.58 | 459.48 | 6.47 | 10.97 | 40 |
Ian McKellen | 11015.59 | 478.94 | 6.35 | 15.45 | 44 |
Johnny Depp | 10653.76 | 217.42 | 6.44 | 12.38 | 69 |
Alan Rickman | 10612.63 | 353.75 | 6.72 | 10.40 | 45 |
plt.figure(figsize = (12, 8))
agg.Total_Revenue.nlargest(10).plot(kind='bar', fontsize = 15)
plt.title("Total Revenue",fontsize = 20)
plt.ylabel("Revenue (in MUSD)", fontsize = 15)
plt.show()