netflix_data.csv

Netflix! What started in 1997 as a DVD rental service has since exploded into one of the largest entertainment and media companies.

Given the large number of movies and series available on the platform, it is a perfect opportunity to flex your exploratory data analysis skills and dive into the entertainment industry.

You work for a production company that specializes in nostalgic styles. You want to do some research on movies released in the 1990’s. You’ll delve into Netflix data and perform exploratory data analysis to better understand this awesome movie decade!

You have been supplied with the dataset netflix_data.csv, along with the following table detailing the column names and descriptions. Feel free to experiment further after submitting!

Column Description
show_id The ID of the show
type Type of show
title Title of the show
director Director of the show
cast Cast of the show
country Country of origin
date_added Date added to Netflix
release_year Year of Netflix release
duration Duration of the show in minutes
description Description of the show
genre Show genre

::: {#320a3abc-8a36-4b2b-baaf-473325363a4d .cell executionCancelledAt=‘null’ executionTime=‘38’ lastExecutedAt=‘1721709310343’ lastExecutedByKernel=‘2467405a-029b-4165-8922-58e9bfe01187’ lastScheduledRunId=‘null’ lastSuccessfullyExecutedCode=’# Importing pandas and matplotlib import pandas as pd import matplotlib.pyplot as plt

Read in the Netflix CSV as a DataFrame

netflix_df = pd.read_csv(“netflix_data.csv”)’ execution_count=12}

# Importing pandas and matplotlib
import pandas as pd
import matplotlib.pyplot as plt

# Read in the Netflix CSV as a DataFrame
netflix_df = pd.read_csv("netflix_data.csv")

:::

netflix_df
show_id type title director cast country date_added release_year duration description genre
0 s2 Movie 7:19 Jorge Michel Grau Demián Bichir, Héctor Bonilla, Oscar Serrano, ... Mexico December 23, 2016 2016 93 After a devastating earthquake hits Mexico Cit... Dramas
1 s3 Movie 23:59 Gilbert Chan Tedd Chan, Stella Chung, Henley Hii, Lawrence ... Singapore December 20, 2018 2011 78 When an army recruit is found dead, his fellow... Horror Movies
2 s4 Movie 9 Shane Acker Elijah Wood, John C. Reilly, Jennifer Connelly... United States November 16, 2017 2009 80 In a postapocalyptic world, rag-doll robots hi... Action
3 s5 Movie 21 Robert Luketic Jim Sturgess, Kevin Spacey, Kate Bosworth, Aar... United States January 1, 2020 2008 123 A brilliant group of students become card-coun... Dramas
4 s6 TV Show 46 Serdar Akar Erdal Beşikçioğlu, Yasemin Allen, Melis Birkan... Turkey July 1, 2017 2016 1 A genetics professor experiments with a treatm... International TV
... ... ... ... ... ... ... ... ... ... ... ...
4807 s7779 Movie Zombieland Ruben Fleischer Jesse Eisenberg, Woody Harrelson, Emma Stone, ... United States November 1, 2019 2009 88 Looking to survive in a world taken over by zo... Comedies
4808 s7781 Movie Zoo Shlok Sharma Shashank Arora, Shweta Tripathi, Rahul Kumar, ... India July 1, 2018 2018 94 A drug dealer starts having doubts about his t... Dramas
4809 s7782 Movie Zoom Peter Hewitt Tim Allen, Courteney Cox, Chevy Chase, Kate Ma... United States January 11, 2020 2006 88 Dragged from civilian life, a former superhero... Children
4810 s7783 Movie Zozo Josef Fares Imad Creidi, Antoinette Turk, Elias Gergi, Car... Sweden October 19, 2020 2005 99 When Lebanon's Civil War deprives Zozo of his ... Dramas
4811 s7784 Movie Zubaan Mozez Singh Vicky Kaushal, Sarah-Jane Dias, Raaghav Chanan... India March 2, 2019 2015 111 A scrappy but poor boy worms his way into a ty... Dramas

4812 rows × 11 columns

::: {#48019b9f-54be-41a4-a75f-0b7296917182 .cell executionCancelledAt=‘null’ executionTime=‘80’ lastExecutedAt=‘1721709310559’ lastExecutedByKernel=‘2467405a-029b-4165-8922-58e9bfe01187’ lastScheduledRunId=‘null’ lastSuccessfullyExecutedCode=’import numpy as np

release_year = netflix_df[“release_year”] ind_90s = np.logical_and(release_year >= 1990, release_year < 2000) netflix_df_90s = netflix_df[ind_90s] netflix_df_90s’ outputsMetadata=‘{“0”:{“height”:335,“type”:“dataFrame”}}’ execution_count=14}

import numpy as np


release_year = netflix_df["release_year"]
ind_90s = np.logical_and(release_year >= 1990, release_year < 2000)
netflix_df_90s = netflix_df[ind_90s]
netflix_df_90s
show_id type title director cast country date_added release_year duration description genre
6 s8 Movie 187 Kevin Reynolds Samuel L. Jackson, John Heard, Kelly Rowan, Cl... United States November 1, 2019 1997 119 After one of his high school students attacks ... Dramas
118 s167 Movie A Dangerous Woman Stephen Gyllenhaal Debra Winger, Barbara Hershey, Gabriel Byrne, ... United States April 1, 2018 1993 101 At the center of this engrossing melodrama is ... Dramas
145 s211 Movie A Night at the Roxbury John Fortenberry Will Ferrell, Chris Kattan, Dan Hedaya, Molly ... United States December 1, 2019 1998 82 After a run-in with Richard Grieco, dimwits Do... Comedies
167 s239 Movie A Thin Line Between Love & Hate Martin Lawrence Martin Lawrence, Lynn Whitfield, Regina King, ... United States December 1, 2020 1996 108 When a philandering club promoter sets out to ... Comedies
194 s274 Movie Aashik Awara Umesh Mehra Saif Ali Khan, Mamta Kulkarni, Mohnish Bahl, S... India June 1, 2017 1993 154 Raised by a kindly thief, orphaned Jimmy goes ... Dramas
... ... ... ... ... ... ... ... ... ... ... ...
4672 s7536 Movie West Beirut Ziad Doueiri Rami Doueiri, Mohamad Chamas, Rola Al Amin, Ca... France October 19, 2020 1999 106 Three intrepid teens roam the streets of Beiru... Dramas
4689 s7571 Movie What's Eating Gilbert Grape Lasse Hallström Johnny Depp, Leonardo DiCaprio, Juliette Lewis... United States January 1, 2021 1993 118 In a backwater Iowa town, young Gilbert is tor... Classic Movies
4718 s7624 Movie Wild Wild West Barry Sonnenfeld Will Smith, Kevin Kline, Kenneth Branagh, Salm... United States January 1, 2020 1999 106 Armed with an ingenious arsenal, two top-notch... Action
4746 s7682 Movie Wyatt Earp Lawrence Kasdan Kevin Costner, Dennis Quaid, Gene Hackman, Dav... United States January 1, 2020 1994 191 Legendary lawman Wyatt Earp is continually at ... Action
4756 s7695 Movie Yaar Gaddar Umesh Mehra Mithun Chakraborty, Saif Ali Khan, Somy Ali, P... India July 1, 2017 1994 148 When his brother becomes involved in a deadly ... Dramas

184 rows × 11 columns

:::

netflix_df_mov_90s = netflix_df_90s[netflix_df_90s["type"] == "Movie"]
netflix_df_mov_90s
show_id type title director cast country date_added release_year duration description genre
6 s8 Movie 187 Kevin Reynolds Samuel L. Jackson, John Heard, Kelly Rowan, Cl... United States November 1, 2019 1997 119 After one of his high school students attacks ... Dramas
118 s167 Movie A Dangerous Woman Stephen Gyllenhaal Debra Winger, Barbara Hershey, Gabriel Byrne, ... United States April 1, 2018 1993 101 At the center of this engrossing melodrama is ... Dramas
145 s211 Movie A Night at the Roxbury John Fortenberry Will Ferrell, Chris Kattan, Dan Hedaya, Molly ... United States December 1, 2019 1998 82 After a run-in with Richard Grieco, dimwits Do... Comedies
167 s239 Movie A Thin Line Between Love & Hate Martin Lawrence Martin Lawrence, Lynn Whitfield, Regina King, ... United States December 1, 2020 1996 108 When a philandering club promoter sets out to ... Comedies
194 s274 Movie Aashik Awara Umesh Mehra Saif Ali Khan, Mamta Kulkarni, Mohnish Bahl, S... India June 1, 2017 1993 154 Raised by a kindly thief, orphaned Jimmy goes ... Dramas
... ... ... ... ... ... ... ... ... ... ... ...
4672 s7536 Movie West Beirut Ziad Doueiri Rami Doueiri, Mohamad Chamas, Rola Al Amin, Ca... France October 19, 2020 1999 106 Three intrepid teens roam the streets of Beiru... Dramas
4689 s7571 Movie What's Eating Gilbert Grape Lasse Hallström Johnny Depp, Leonardo DiCaprio, Juliette Lewis... United States January 1, 2021 1993 118 In a backwater Iowa town, young Gilbert is tor... Classic Movies
4718 s7624 Movie Wild Wild West Barry Sonnenfeld Will Smith, Kevin Kline, Kenneth Branagh, Salm... United States January 1, 2020 1999 106 Armed with an ingenious arsenal, two top-notch... Action
4746 s7682 Movie Wyatt Earp Lawrence Kasdan Kevin Costner, Dennis Quaid, Gene Hackman, Dav... United States January 1, 2020 1994 191 Legendary lawman Wyatt Earp is continually at ... Action
4756 s7695 Movie Yaar Gaddar Umesh Mehra Mithun Chakraborty, Saif Ali Khan, Somy Ali, P... India July 1, 2017 1994 148 When his brother becomes involved in a deadly ... Dramas

183 rows × 11 columns

::: {#56537e74-93a0-420f-9e97-b9fe68d64381 .cell executionCancelledAt=‘null’ executionTime=‘214’ lastExecutedAt=‘1721709310845’ lastExecutedByKernel=‘2467405a-029b-4165-8922-58e9bfe01187’ lastScheduledRunId=‘null’ lastSuccessfullyExecutedCode=’dur_90s = netflix_df_mov_90s[“duration”] plt.hist(dur_90s, bins=30) plt.xlabel(“Duration”) plt.ylabel(“Frequency”) plt.show()

duration = dur_90s.mode()[0] duration duration print(duration)’ outputsMetadata=‘{“1”:{“height”:38,“type”:“stream”}}’ execution_count=16}

dur_90s = netflix_df_mov_90s["duration"]
plt.hist(dur_90s, bins=30)
plt.xlabel("Duration")
plt.ylabel("Frequency")
plt.show()


duration = dur_90s.mode()[0] 
duration
duration
print(duration)

94

:::

::: {#296bafdb-f540-4332-b50d-eb840ae86be1 .cell executionCancelledAt=‘null’ executionTime=‘55’ lastExecutedAt=‘1721709310900’ lastExecutedByKernel=‘2467405a-029b-4165-8922-58e9bfe01187’ lastScheduledRunId=‘null’ lastSuccessfullyExecutedCode=’action_mov_90s = netflix_df_mov_90s[netflix_df_mov_90s[“genre”] == “Action”] action_mov_90s_dur = action_mov_90s[“duration”]

short_movie_count = 0 for dur in action_mov_90s_dur: if dur < 90: short_movie_count += 1 short_movie_count print(short_movie_count)’ outputsMetadata=‘{“0”:{“height”:38,“type”:“stream”}}’ execution_count=17}

action_mov_90s = netflix_df_mov_90s[netflix_df_mov_90s["genre"] == "Action"]
action_mov_90s_dur = action_mov_90s["duration"]

short_movie_count = 0
for dur in action_mov_90s_dur:
    if dur < 90:
        short_movie_count += 1
short_movie_count
print(short_movie_count)
7

:::