Peter Allenspach
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
‌
Sign up
Beta
Spinner

Netflix Top 10: Analyzing Weekly Chart-Toppers

This dataset comprises Netflix's weekly top 10 lists for the most-watched TV shows and films worldwide. The data spans from June 28, 2021, to August 27, 2023.

This workspace is pre-loaded with two CSV files.

  • netflix_top10.csv contains columns such as show_title, category, weekly_rank, and several view metrics.
  • netflix_top10_country.csv has information about a show or film's performance by country, contained in the columns cumulative_weeks_in_top_10 and weekly_rank.

We've added some guiding questions for analyzing this exciting dataset! Feel free to make this workspace yours by adding and removing cells, or editing any of the existing cells.

Source: Netflix

Explore this dataset

To get you started with your analysis...

  1. Combine the different categories of top 10 lists in a single weekly top 10 list spanning all categories
  2. Are there consistent trends or patterns in the content format (tv, film) that make it to the top 10 over different weeks or months?
  3. Explore your country's top 10 trends. Are there unique preferences or regional factors that set your country's list apart from others?
  4. Visualize popularity ranking over time through time series plots

🔍 Scenario: Understanding the Impact of Content Duration on Netflix's Top 10 Lists

This scenario helps you develop an end-to-end project for your portfolio.

Background: As a data scientist at Netflix, you're tasked with exploring the dataset containing weekly top 10 lists of the most-watched TV shows and films. For example, you're tasked to find out what the relationship is between duration and ranking over time. Answering this question can inform content creators and strategists on how to optimize their offerings for the platform.

Objective: Determine if there's a correlation between content duration and its likelihood of making it to the top 10 lists.

You can query the pre-loaded CSV files using SQL directly. Here’s a sample query:

Unknown integration
DataFrameavailable as
df
variable
SELECT week, count(1)
FROM 'netflix_top10.csv'
GROUP BY week
order by 1 desc
This query is taking long to finish...Consider adding a LIMIT clause or switching to Query mode to preview the result.
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np

global_top_10 = pd.read_csv("netflix_top10.csv", index_col=0)

global_top_10 = global_top_10.drop('weekly_hours_viewed', axis=1)

global_top_10.head(25)


matrix = global_top_10.corr().round(2)
print(matrix)
mask = np.triu(np.ones_like(matrix, dtype=bool))
sns.heatmap(matrix, annot=True, vmax=1, vmin=-1, center=0, cmap='vlag', mask=mask)
plt.show()
countries_top_10 = pd.read_csv("netflix_top10_country.csv", index_col=0)
countries_top_10.head()

Ready to share your work?

Click "Share" in the upper right corner, copy the link, and share it! You can also add this workspace to your DataCamp Portfolio

  • AI Chat
  • Code