Lab 3 Sentimental Analysis
Lab 3 Sentimental Analysis
We can create a bar chart to visualize the distribution of content types (Movies and TV Shows) in
the dataset. This will show how many of each type are available on Netflix.
import matplotlib.pyplot as plt
import seaborn as sns
the bar plot shows the top 10 most popular genres on Netflix based on the available content. It
gives us insights into which types of shows and movies are widely available on the platform,
reflecting user preferences and helping Netflix make decisions about content strategy.
plt.figure(figsize=(10, 6))
sns.histplot(data=data, x='release_year', bins=30)
plt.title('Release Year Distribution')
plt.xlabel('Release Year')
plt.ylabel('Count')
plt.xticks(rotation=45)
plt.show()
the bar plot indicates that Netflix offers a diverse range of content genres. Genres like
dramas, comedies, and documentaries are highly prevalent, suggesting strong user
interest. This information guides Netflix's content strategy and improves content
recommendations for users.
top_countries = data['country'].value_counts().head(10)
plt.figure(figsize=(10, 6))
sns.barplot(x=top_countries.index, y=top_countries.values)
plt.title('Top Countries for Content Production')
plt.xlabel('Country')
plt.ylabel('Count')
plt.xticks(rotation=45)
plt.show()
The bar chart indicates that the United States is the leading producer of content on Netflix,
followed by several other countries. This diversity reflects Netflix's commitment to offering a
wide range of content to its international audience, shaping its content strategy, and tailoring
recommendations to regional preferences.
Rating Distribution:
• Visualize the distribution of content ratings (e.g., PG, TV-MA) using a bar
chart or pie chart. This can show the diversity of content ratings available.
sns.countplot(data=data, x='rating')
plt.title('Rating Distribution')
plt.xlabel('Content Rating')
plt.ylabel('Count')
plt.xticks(rotation=45)
plt.show()
From the graph,"Rating Distribution" count plot reveals a diverse range of content ratings on
Netflix, catering to various age groups and preferences. TV-MA is notably common,
indicating a significant amount of mature content. Netflix uses these ratings to target different
audiences and curate its content library for personalized recommendations.
Genres Distribution:
• Create a bar chart to display the distribution of content across different genres
(listed_in column). This can help identify popular genres on Netflix.
top_genres = data['listed_in'].value_counts().head(10)
plt.figure(figsize=(10, 6))
sns.barplot(x=top_genres.values, y=top_genres.index)
plt.title('Top 10 Genres on Netflix')
plt.xlabel('Count')
plt.ylabel('Genre')
plt.show()
The "Top 10 Genres on Netflix" bar chart reveals the most popular content genres on the
platform. It reflects the diversity of content available, user preferences, and helps Netflix
shape its content strategy and recommendations for its audience.