{ "cells": [ { "source": [ "**Netflix**! What started in 1997 as a DVD rental service has since exploded into one of the largest entertainment and media companies.\n", "\n", "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. Our friend has also been brushing up on their Python skills and has taken a first crack at a CSV file containing Netflix data. They believe that the average duration of movies has been declining. Using your friends initial research, you'll delve into the Netflix data to see if you can determine whether movie lengths are actually getting shorter and explain some of the contributing factors, if any.\n", "\n", "You have been supplied with the dataset `netflix_data.csv` , along with the following table detailing the column names and descriptions:\n", "\n", "## The data\n", "### **netflix_data.csv**\n", "| Column | Description |\n", "|----------------|---------------------------------|\n", "| `show_id` | The ID of the show |\n", "| `type` | Type of show |\n", "| `title` | Title of the show |\n", "| `director` | Director of the show |\n", "| `cast` | Cast of the show |\n", "| `country` | Country of origin |\n", "| `date_added` | Date added to Netflix |\n", "| `release_year` | Year of Netflix release |\n", "| `duration` | Duration of the show in minutes |\n", "| `description` | Description of the show |\n", "| `genre` | Show genre |" ], "metadata": {}, "id": "5962b2cd-17bb-4ec9-b2d5-68537ca26860", "cell_type": "markdown" }, { "source": [ "# Importing pandas and matplotlib\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "\n", "# Start coding!" ], "metadata": { "executionTime": 9, "lastSuccessfullyExecutedCode": "# Importing pandas and matplotlib\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# Start coding!", "executionCancelledAt": null, "lastExecutedAt": 1702531922597, "lastScheduledRunId": null, "ExecuteTime": { "end_time": "2023-12-14T05:35:39.627915800Z", "start_time": "2023-12-14T05:35:39.592638600Z" } }, "id": "320a3abc-8a36-4b2b-baaf-473325363a4d", "cell_type": "code", "execution_count": 17, "outputs": [] }, { "source": [ "Reading csv and printing dataframe:" ], "metadata": {}, "cell_type": "markdown", "id": "0edf3124-7400-423a-9d0d-337d3a5d1b9b" }, { "source": [ "netflix_df = pd.read_csv('datasets/netflix_data.csv')\n", "netflix_df" ], "metadata": { "executionCancelledAt": null, "executionTime": 239, "lastExecutedAt": 1702531922836, "lastScheduledRunId": null, "lastSuccessfullyExecutedCode": "netflix_df = pd.read_csv('netflix_data.csv')\nnetflix_df", "outputsMetadata": { "0": { "height": 338, "type": "dataFrame" } }, "ExecuteTime": { "end_time": "2023-12-14T05:35:39.782507900Z", "start_time": "2023-12-14T05:35:39.632460700Z" } }, "cell_type": "code", "id": "47c99365-94cc-42db-b235-66225784dfba", "execution_count": 18, "outputs": [ { "data": { "text/plain": " show_id type title \\\n0 s1 TV Show 3% \n1 s2 Movie 7:19 \n2 s3 Movie 23:59 \n3 s4 Movie 9 \n4 s5 Movie 21 \n... ... ... ... \n7782 s7783 Movie Zozo \n7783 s7784 Movie Zubaan \n7784 s7785 Movie Zulu Man in Japan \n7785 s7786 TV Show Zumbo's Just Desserts \n7786 s7787 Movie ZZ TOP: THAT LITTLE OL' BAND FROM TEXAS \n\n director cast \\\n0 NaN João Miguel, Bianca Comparato, Michel Gomes, R... \n1 Jorge Michel Grau Demián Bichir, Héctor Bonilla, Oscar Serrano, ... \n2 Gilbert Chan Tedd Chan, Stella Chung, Henley Hii, Lawrence ... \n3 Shane Acker Elijah Wood, John C. Reilly, Jennifer Connelly... \n4 Robert Luketic Jim Sturgess, Kevin Spacey, Kate Bosworth, Aar... \n... ... ... \n7782 Josef Fares Imad Creidi, Antoinette Turk, Elias Gergi, Car... \n7783 Mozez Singh Vicky Kaushal, Sarah-Jane Dias, Raaghav Chanan... \n7784 NaN Nasty C \n7785 NaN Adriano Zumbo, Rachel Khoo \n7786 Sam Dunn NaN \n\n country date_added release_year duration \\\n0 Brazil August 14, 2020 2020 4 \n1 Mexico December 23, 2016 2016 93 \n2 Singapore December 20, 2018 2011 78 \n3 United States November 16, 2017 2009 80 \n4 United States January 1, 2020 2008 123 \n... ... ... ... ... \n7782 Sweden October 19, 2020 2005 99 \n7783 India March 2, 2019 2015 111 \n7784 NaN September 25, 2020 2019 44 \n7785 Australia October 31, 2020 2019 1 \n7786 United Kingdom March 1, 2020 2019 90 \n\n description genre \n0 In a future where the elite inhabit an island ... International TV \n1 After a devastating earthquake hits Mexico Cit... Dramas \n2 When an army recruit is found dead, his fellow... Horror Movies \n3 In a postapocalyptic world, rag-doll robots hi... Action \n4 A brilliant group of students become card-coun... Dramas \n... ... ... \n7782 When Lebanon's Civil War deprives Zozo of his ... Dramas \n7783 A scrappy but poor boy worms his way into a ty... Dramas \n7784 In this documentary, South African rapper Nast... Documentaries \n7785 Dessert wizard Adriano Zumbo looks for the nex... International TV \n7786 This documentary delves into the mystique behi... Documentaries \n\n[7787 rows x 11 columns]", "text/html": "
\n | show_id | \ntype | \ntitle | \ndirector | \ncast | \ncountry | \ndate_added | \nrelease_year | \nduration | \ndescription | \ngenre | \n
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \ns1 | \nTV Show | \n3% | \nNaN | \nJoão Miguel, Bianca Comparato, Michel Gomes, R... | \nBrazil | \nAugust 14, 2020 | \n2020 | \n4 | \nIn a future where the elite inhabit an island ... | \nInternational TV | \n
1 | \ns2 | \nMovie | \n7:19 | \nJorge Michel Grau | \nDemián Bichir, Héctor Bonilla, Oscar Serrano, ... | \nMexico | \nDecember 23, 2016 | \n2016 | \n93 | \nAfter a devastating earthquake hits Mexico Cit... | \nDramas | \n
2 | \ns3 | \nMovie | \n23:59 | \nGilbert Chan | \nTedd Chan, Stella Chung, Henley Hii, Lawrence ... | \nSingapore | \nDecember 20, 2018 | \n2011 | \n78 | \nWhen an army recruit is found dead, his fellow... | \nHorror Movies | \n
3 | \ns4 | \nMovie | \n9 | \nShane Acker | \nElijah Wood, John C. Reilly, Jennifer Connelly... | \nUnited States | \nNovember 16, 2017 | \n2009 | \n80 | \nIn a postapocalyptic world, rag-doll robots hi... | \nAction | \n
4 | \ns5 | \nMovie | \n21 | \nRobert Luketic | \nJim Sturgess, Kevin Spacey, Kate Bosworth, Aar... | \nUnited States | \nJanuary 1, 2020 | \n2008 | \n123 | \nA brilliant group of students become card-coun... | \nDramas | \n
... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n
7782 | \ns7783 | \nMovie | \nZozo | \nJosef Fares | \nImad Creidi, Antoinette Turk, Elias Gergi, Car... | \nSweden | \nOctober 19, 2020 | \n2005 | \n99 | \nWhen Lebanon's Civil War deprives Zozo of his ... | \nDramas | \n
7783 | \ns7784 | \nMovie | \nZubaan | \nMozez Singh | \nVicky Kaushal, Sarah-Jane Dias, Raaghav Chanan... | \nIndia | \nMarch 2, 2019 | \n2015 | \n111 | \nA scrappy but poor boy worms his way into a ty... | \nDramas | \n
7784 | \ns7785 | \nMovie | \nZulu Man in Japan | \nNaN | \nNasty C | \nNaN | \nSeptember 25, 2020 | \n2019 | \n44 | \nIn this documentary, South African rapper Nast... | \nDocumentaries | \n
7785 | \ns7786 | \nTV Show | \nZumbo's Just Desserts | \nNaN | \nAdriano Zumbo, Rachel Khoo | \nAustralia | \nOctober 31, 2020 | \n2019 | \n1 | \nDessert wizard Adriano Zumbo looks for the nex... | \nInternational TV | \n
7786 | \ns7787 | \nMovie | \nZZ TOP: THAT LITTLE OL' BAND FROM TEXAS | \nSam Dunn | \nNaN | \nUnited Kingdom | \nMarch 1, 2020 | \n2019 | \n90 | \nThis documentary delves into the mystique behi... | \nDocumentaries | \n
7787 rows × 11 columns
\n\n | show_id | \ntype | \ntitle | \ndirector | \ncast | \ncountry | \ndate_added | \nrelease_year | \nduration | \ndescription | \ngenre | \n
---|---|---|---|---|---|---|---|---|---|---|---|
1 | \ns2 | \nMovie | \n7:19 | \nJorge Michel Grau | \nDemián Bichir, Héctor Bonilla, Oscar Serrano, ... | \nMexico | \nDecember 23, 2016 | \n2016 | \n93 | \nAfter a devastating earthquake hits Mexico Cit... | \nDramas | \n
2 | \ns3 | \nMovie | \n23:59 | \nGilbert Chan | \nTedd Chan, Stella Chung, Henley Hii, Lawrence ... | \nSingapore | \nDecember 20, 2018 | \n2011 | \n78 | \nWhen an army recruit is found dead, his fellow... | \nHorror Movies | \n
3 | \ns4 | \nMovie | \n9 | \nShane Acker | \nElijah Wood, John C. Reilly, Jennifer Connelly... | \nUnited States | \nNovember 16, 2017 | \n2009 | \n80 | \nIn a postapocalyptic world, rag-doll robots hi... | \nAction | \n
4 | \ns5 | \nMovie | \n21 | \nRobert Luketic | \nJim Sturgess, Kevin Spacey, Kate Bosworth, Aar... | \nUnited States | \nJanuary 1, 2020 | \n2008 | \n123 | \nA brilliant group of students become card-coun... | \nDramas | \n
6 | \ns7 | \nMovie | \n122 | \nYasir Al Yasiri | \nAmina Khalil, Ahmed Dawood, Tarek Lotfy, Ahmed... | \nEgypt | \nJune 1, 2020 | \n2019 | \n95 | \nAfter an awful accident, a couple admitted to ... | \nHorror Movies | \n
... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n... | \n
7781 | \ns7782 | \nMovie | \nZoom | \nPeter Hewitt | \nTim Allen, Courteney Cox, Chevy Chase, Kate Ma... | \nUnited States | \nJanuary 11, 2020 | \n2006 | \n88 | \nDragged from civilian life, a former superhero... | \nChildren | \n
7782 | \ns7783 | \nMovie | \nZozo | \nJosef Fares | \nImad Creidi, Antoinette Turk, Elias Gergi, Car... | \nSweden | \nOctober 19, 2020 | \n2005 | \n99 | \nWhen Lebanon's Civil War deprives Zozo of his ... | \nDramas | \n
7783 | \ns7784 | \nMovie | \nZubaan | \nMozez Singh | \nVicky Kaushal, Sarah-Jane Dias, Raaghav Chanan... | \nIndia | \nMarch 2, 2019 | \n2015 | \n111 | \nA scrappy but poor boy worms his way into a ty... | \nDramas | \n
7784 | \ns7785 | \nMovie | \nZulu Man in Japan | \nNaN | \nNasty C | \nNaN | \nSeptember 25, 2020 | \n2019 | \n44 | \nIn this documentary, South African rapper Nast... | \nDocumentaries | \n
7786 | \ns7787 | \nMovie | \nZZ TOP: THAT LITTLE OL' BAND FROM TEXAS | \nSam Dunn | \nNaN | \nUnited Kingdom | \nMarch 1, 2020 | \n2019 | \n90 | \nThis documentary delves into the mystique behi... | \nDocumentaries | \n
5377 rows × 11 columns
\n\n | title | \ncountry | \ngenre | \nrelease_year | \nduration | \n
---|---|---|---|---|---|
1 | \n7:19 | \nMexico | \nDramas | \n2016 | \n93 | \n
2 | \n23:59 | \nSingapore | \nHorror Movies | \n2011 | \n78 | \n
3 | \n9 | \nUnited States | \nAction | \n2009 | \n80 | \n
4 | \n21 | \nUnited States | \nDramas | \n2008 | \n123 | \n
6 | \n122 | \nEgypt | \nHorror Movies | \n2019 | \n95 | \n
... | \n... | \n... | \n... | \n... | \n... | \n
7781 | \nZoom | \nUnited States | \nChildren | \n2006 | \n88 | \n
7782 | \nZozo | \nSweden | \nDramas | \n2005 | \n99 | \n
7783 | \nZubaan | \nIndia | \nDramas | \n2015 | \n111 | \n
7784 | \nZulu Man in Japan | \nNaN | \nDocumentaries | \n2019 | \n44 | \n
7786 | \nZZ TOP: THAT LITTLE OL' BAND FROM TEXAS | \nUnited Kingdom | \nDocumentaries | \n2019 | \n90 | \n
5377 rows × 5 columns
\n\n | title | \ncountry | \ngenre | \nrelease_year | \nduration | \n
---|---|---|---|---|---|
35 | \n#Rucker50 | \nUnited States | \nDocumentaries | \n2016 | \n56 | \n
55 | \n100 Things to do Before High School | \nUnited States | \nUncategorized | \n2014 | \n44 | \n
67 | \n13TH: A Conversation with Oprah Winfrey & Ava ... | \nNaN | \nUncategorized | \n2017 | \n37 | \n
101 | \n3 Seconds Divorce | \nCanada | \nDocumentaries | \n2018 | \n53 | \n
146 | \nA 3 Minute Hug | \nMexico | \nDocumentaries | \n2019 | \n28 | \n
... | \n... | \n... | \n... | \n... | \n... | \n
7679 | \nWWII: Report from the Aleutians | \nUnited States | \nDocumentaries | \n1943 | \n45 | \n
7692 | \nYa no estoy aquí: Una conversación entre Guill... | \nNaN | \nDocumentaries | \n2020 | \n15 | \n
7718 | \nYoo Byung Jae: Discomfort Zone | \nSouth Korea | \nStand-Up | \n2018 | \n54 | \n
7771 | \nZion | \nUnited States | \nDocumentaries | \n2018 | \n12 | \n
7784 | \nZulu Man in Japan | \nNaN | \nDocumentaries | \n2019 | \n44 | \n
420 rows × 5 columns
\n