Question
I am making a bar plot to count the frequency of show genres for 20 shows. Using the following code, I am able to make
I am making a bar plot to count the frequency of show genres for 20 shows. Using the following code, I am able to make a nice plot but the several movies have their genres listed in the python df with commas in the middle (i.e,, if a movie has more than 1 genre then they are all included in the genre column with a "," separating them). That is why, when I make the plot, there are genre classes that include more than one genre in the plot but I want to divide them into one category so one movie that has more than one genre counts in the bar plot for each of the genres it is of and not as a separate genre category). Please tell me know to correct this error. Thank you
bar1 = df1['genres'].value_counts(normalize=True, ascending = False).plot(kind='barh',
title="Frequency of Genres of Top 10 Shows")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started