Skip to content
1 hidden cell
Project: Investigating Netflix Movies
Netflix Movie Investigation
1 hidden cell
# 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 like
import matplotlib.pyplot as plt
# subset the dataframe for type "Movie"
netflix_subset = netflix_df[netflix_df["type"] == "Movie"]
subset = netflix_subset[(netflix_subset["release_year"] >= 1990)]
movies_1990s = subset[(subset["release_year"] < 2000)]
plt.hist(movies_1990s["duration"])
plt.title('Distribution of Movie Duration in the 1990s')
plt.xlabel('Duration (minutes)')
plt.ylabel('Number of Movies')
plt.show()
duration = 100
action_movies_1990s = movies_1990s[movies_1990s["genre"] == "Action"]
short_movie_count = 0
for label, row in action_movies_1990s.iterrows():
if row["duration"] < 90:
short_movie_count += 1
print(short_movie_count)