plt.xlabel=('Month') not working

Screen Link:

My Code:

# Generate the same line chart from the last screen that visualizes the unemployment rates from 1948.
x_values = unrate['DATE'].head(12)
y_values = unrate['VALUE'].head(12)
plt.plot(x_values, y_values)
# Set the x-axis label to "Month".
# Set the y-axis label to "Unemployment Rate".
plt.ylabel('Unemployment Rate')
# # Set the plot title to "Monthly Unemployment Trends, 1948".
plt.title('Monthly Unemployment Trends, 1948')
# Display the plot.

What I expected to happen:

The x-axis label should have change to "Month"

What actually happened:


The plt.xlabel=('Month') does not seem to work, because the label on the x-axis does not change.
Can anyone tell me how to fix this, or any workaround?
I used a different browser as well but with the same result.

Hi @annalisa:

You used

The correct syntax should be
plt.xlabel('Month') with no = sign since there is no assignment of values into variables. You can also find out more about its uses using the documentation.

Hope this helps!


Thanks a lot! I totally missed that!

no worries @annalisa! Happy Pythoning!

Actually that did not fix the problem, now I have this error:

Hi @annalisa

I managed to run your code successfully. Maybe you could rerun it.

If it still does not work you could try this:
For part 7/11 of the mission, you should already assign the slice to another variable as shown in the solution for part 7 below.
Thereafter you can then make use of the variable first_twelve .

Hope this helps!

I just re-run it and it worked, without changint anything… literally opened the screen and rerun… Thanks for looking into it though! :blush:

no problem. Sometimes these things happen!