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!
The data
netflix_data.csv
| 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 |
We have csv format data which is not easily understandable if there are tons of data. So panda helps us to organise csv data into organised and tabular way like into rows and columns which is dataframe. ** First task is to import panda and other necessary library like matplot to analyse data graphically. now when a data frame is created our first job is to analyse data. how it looks so we are using .head() function to see first few rows of data and .info() tells us total entries, dataype of each column. .describe() tells statistical result of numerical column such as : mean,standard deviation, min, quartile range and max. then we look for missing values. If there are any missing value we'll go with handeling missing value techniques but in this case no missing values are there so we will directly jump into analysing the dataset further and we'll answer the question which is arising after analysis.
*Questions: What was the most frequent movie duration in the 1990s? Save an approximate answer as an integer called duration (use 1990 as the decade's start year). -Answer- Action movie- 48 times and total duration in minutes: 5767
*Question: A movie is considered short if it is less than 90 minutes. Count the number of short action movies released in the 1990s and save this integer as short_movie_count. -Answer- 7
# 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")# Start coding here! Use as many cells as you likenetflix_df.head(3)
netflix_df.info()netflix_df.describe()# Count missing values in each column
missing_values = netflix_df.isnull().sum()
missing_values#Filter the data for movies released in the 1990s
netflix_df_1990s = netflix_df[(netflix_df['release_year'] >= 1990) & (netflix_df['release_year'] < 2000) & (netflix_df['type'] == 'Movie')]
print(netflix_df_1990s)##most frequent movie duration
most_frequent_1990s_movie_duration = netflix_df_1990s['duration'].mode()[0]duration = most_frequent_1990s_movie_duration
print(f"\nMost frequent movie duration in the 1990s:", duration)# Visualizing the distribution of movie durations in the 1990s
plt.figure(figsize=(10,4))
plt.hist(netflix_df_1990s['duration'], bins=200, color='skyblue', edgecolor='black')
plt.title('Distribution of Movie Durations in the 1990s')
plt.xlabel('Duration (minutes)')
plt.ylabel('Frequency')
plt.show()A movie is considered short if it is less than 90 minutes. Count the number of short action movies released in the 1990s and save this integer as short_movie_count.