Pie chart label insists I shouldn't omit it! Help 😕

Hello,

Here’s the link to the mission page I’m stuck at.

For this page, I wrote the code below which is basically the same as the answer:

import matplotlib.pyplot as plt

wnba["Exp_ordinal"].value_counts().plot.pie(figsize=(6,6), autopct="%.2f%%", title="Percentage of players in WNBA by level of experience")
plt.ylabel('')

It’s giving a type error saying this:

TypeErrorTraceback (most recent call last)
<ipython-input-1-b40075ca9345> in <module>()
      2 
      3 wnba["Exp_ordinal"].value_counts().plot.pie(figsize=(6,6), autopct="%.2f%%", title="Percentage of players in WNBA by level of experience")
----> 4 plt.ylabel('')

TypeError: 'str' object is not callable

I wonder what went wrong here.

1 Like

Hello @dilarakrby.

Your code works just fine on my computer.

What might be happening is that at some point before running this code you posted, you defined plt.label as some string. From that point on, plt.ylabel is a string, which cannot be called.

Try to restart the kernel or to leave the mission before trying again.

2 Likes