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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!