A data analysis notebook that explores the Netflix titles dataset — genre breakdowns, release trends, and top countries.
Read the CSV and take a first look at the structure.
import pandas as pd
df = pd.read_csv('netflix_titles.csv')
print(df.shape)
print(df.dtypes)
print(df.head(3))
(8807, 12) type object title object director object ... (8807, 12) rows × 12 columns
Handle missing values and parse dates.
# Fill missing values
df['director'].fillna('Unknown', inplace=True)
df['country'].fillna('Unknown', inplace=True)
# Parse date added
df['date_added'] = pd.to_datetime(df['date_added'].str.strip(), errors='coerce')
df['year_added'] = df['date_added'].dt.year
print(df.isnull().sum())
Find the most common genres and plot content added per year.
import matplotlib.pyplot as plt
# Movies vs TV Shows
print(df['type'].value_counts())
# Top genres
genres = df['listed_in'].str.split(', ').explode()
top_genres = genres.value_counts().head(10)
print(top_genres)
# Content added per year
df.groupby('year_added')['show_id'].count().plot(kind='bar', figsize=(10,4), title='Titles Added Per Year')
plt.tight_layout()
plt.savefig('netflix_trends.png', dpi=150)
print("Chart saved.")
type Movie 6131 TV Show 2676 ... Documentaries 299 Stand-Up Comedy 273 ... Chart saved.
You have completed your first real data analysis. Upload the notebook to Kaggle or GitHub to show employers you can work with real datasets.
Spotted a bug, broken code, or something that doesn't look right? Tell us what's off and we'll fix it.