Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

I am trying to normalize the axis of my bar plot and make the bars show up in descending order. Using the following code: df

I am trying to normalize the axis of my bar plot and make the bars show up in descending order. Using the following code:

df = df.sort_values(by='genres', ascending=False)

df.groupby(['genres','gender'])['genres'].count().unstack().plot(kind='barh', rot =0,

color=['pink', 'purple'], stacked=True, title ="Genres of Top 10 Shows by Gender", normed=True)

plt.show()

I get the following error:

AttributeError: 'Rectangle' object has no property 'normalize'

Can someone please let me know how to correct this? I am working on google collab python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions