Case Study: An Exploratory Data Analysis Of Netflix Content (2008–2020) with Python
By: Emmanuel Ayeni
Tags: Data Science, Python, Netflix, Data Analysis, Data Visualization

Introduction

Exploratory Data Analysis or EDA as it is commonly called is a process or stage in any data science project that cannot be overlooked or talked about enough.

This is where the data scientist or data analyst (as the case may be) “gets a feel or understands” the data he/she wants to build a model on.

In cases where the end product of such a project isn’t some ML or AI product, EDA can result in great insights and recommendations about business problems through pattern discovery, hypothesis testing, and checking of assumptions. All these are usually achieved with help of summary statistics and data visualizations.

The ultimate aim here is to aid effective and efficient decision making which may affect businesses positively.

In this article, we are not going to be deploying any model to create an ML or AI product after our EDA. We’re simply going to use EDA to “explore” and gain an understanding of a dataset containing Netflix’s contents between 2008 and 2020. We’re basically going to be using EDA to get a “quick summary” of what the dataset contains.

Netflix is a content platform that offers subscription-based streaming services, offering online streaming from a library of films and TV-series. The popularity of Netflix no doubt hit new levels this year due to the “almost” worldwide lock-down which resulted as a response to the Covid-19 pandemic that hit most countries of the world.

Importing Libraries

The first step towards any form of EDA is the import importation of necessary python libraries we would be needing for our analysis. While the majority of these libraries are imported at the start of the analysis, some libraries are imported “as needed” as the analysis progresses. Our imported libraries are shown below;

As seen in the image above, all imported libraries have their specific uses from data preprocessing and analysis to data visualizations.

Data Type, Null Values & Summaries

After importing our libraries, we then take a quick look at what our data looks like. This is shown in image 1 below. Image 2, 3 & 4 gives a brief summary of what the columns of our data contain. From Image 4 we can see that the dataset contains over 6 thousand records based on the total number of IDs which the the primary key.

Image 1

Image 2

Image 3

Image 4

There’s usually discrepancies in the dataset when it comes to data science project whether it is a structured or unstructured data. The EDA is where these discrepancies are usually resolved. These discrepancies may include but not limited to null values, duplicates, wrong data, incorrect values, etc. Let’s see what kind of discrepancies our Netflix dataset contains;

The only discrepancy our data contains is null value which are found in 5 columns. We’ve discussed some ways in which we can treat them in an earlier article which can be found here.

A method I prefer to use when performing EDA on any dataset is to pose a series of questions I want the dataset to answer. These questions serve as guidelines for gaining simple yet massive insights into the data in question. Thus, we would be adopting a “question-method” in order to show how valuable EDA is to data science projects and solving business problems in general.

Movies or TV-Shows?

Netflix primarily lists two types of contents -movies and TV-shows on their streaming sites. The simple donuts-chart below shows in a glance that Netflix uploaded more movies than TV-shows between 2008 and 2020.

We’ve already gotten from the image above that movies are the most uploaded contents. The image below shows us an extra information. It shows the trend of the number of contents added year-on-year. As seen, little to no contents were added between 2008 and 2014. The number of contents added however began to rise from 2015 to mid 2019 which is the peak, before dipping from late 2019 to early 2020.

What are the top producing countries?

The streaming site from Netflix lists contents from different countries and in different languages. The bar chart below shows us the top 10 countries with the most contents on Netflix. United States is first with contents doubling that of India who is second. United Kingdom came third while Turkey and Mexico complete the top 10 list.

Monthly and Daily Trend

We’ve seen how most of the contents added peaked at mid 2019. It would be more insightful if we go further and see which month of the year and day of the week most contents were uploaded.

As seen from the line chart above, majority of Netflix’s contents were uploaded from middle of the year to the end of year as we approach the holidays, with most uploaded in December. This is understandable as many people spend more time at home with family and friends during this time. Or it could also just be Netflix following another set of data that shows majority of its customers watch more contents towards the end of the year. Or simply the calendar of movie producers who spend all summer shooting movies.

From the bar chart above, we can see that majority of its contents were uploaded steadily everyday with minimal difference except for Friday when the number is significantly high. Unfortunately our data does not include the actual time stamp contents were uploaded, we would have been gotten more insights maybe they were uploaded against the weekend when traffic may be higher than weekdays.

Duration of contents?

The histogram above shows us that majority of the movies uploaded has a duration between 70 minutes and 120 minutes with the actual median duration being 98 minutes. We have number of outliers below 40 minutes and above 160 minutes.

TV-shows on the other hand has majority of its contents being between 1 and 3 seasons with 1 season TV-shows having a significantly high number.

What are the top categories and directors?

All contents on Netflix are grouped into categories regardless if its a movie or TV-show. The word-cloud below gives a brief over view of the top categories. The bigger the word the higher the number of contents.

Top Categories

The word-cloud above shows us that the top categories include international movies, TV-shows, independent movies, action, adventure, romantics movies, comedies, dramas, etc. Some other categories with low contents as shown by the size of their text include anime series, documentaries science, faith spirituality, adventure anime, etc.

Top Directors

The word-cloud above shows the directors with the highest number of contents. Raul Campos and Jan Suter come in first position. Other top directors include Steven Spielberg, Jay Chapman, Shannon Hartman, Marcus Raboy, etc.

Type of contents Netflix uploads?

One very important factor to consider when watching any Netflix content especially when watching with family where kids are involved is the ratings of such content. The chart below shows that majority of Netflix content whether movies or TV-shows are rated TV-MA. This type of contents are for mature, adult audiences and therefore unsuitable for children. The second highest type of contents are for children that are 14 year-old and above. These are rated TV-14. Meaning of other ratings can be found here

Conclusion

So far, we’ve been able to give a brief description of our data and get some valuable insights which have been communicated via visualizations. However, please note that EDA is not limited to all we have discussed here. To understand more on how these visualizations and the little data cleaning that went into them please check the notebook here

Thank you for your time. To see more about this analysis, see the link to my GitHub here. You can connect with me on LinkedIn + Twitter