Rejected answer

Screen Link:
https://app.dataquest.io/m/143/multiple-plots/11/final-tweaks

My Code:

fig = plt.figure(figsize=(10,6))
colors = ['red', 'blue', 'green', 'orange', 'black']
for i in range(5):
    start_index = i*12
    end_index = (i+1)*12
    subset = unrate[start_index:end_index]
    label = str(1948 + i)
    plt.plot(subset['MONTH'], subset['VALUE'], c=colors[i], label=label)
plt.legend(loc='upper left')
plt.xlabel("Month, Integer")
plt.ylabel("Unemployment Rate, Percent")
plt.title("Monthly Unemployment Trends, 1948-1952")
plt.show()

What I expected to happen:

I expected my answer is accepted and I move on.

What actually happened:

My answer was not accepted, the message was “Your plot does not match what we expected”

Replace this line with the output/error

For whatever reason the system says my plot is not what was expected. But please see the screenshot of the two plots and maybe there is a difference that I do not see?

I have compared the answer with my code and they are identical.

If anyone can explain me what I am doing wrong here, your help is much appreciated. Thank you!

3 Likes

Hello @ntokoldoshev, your code is Okay, it seems there is a possible bug on the DataQuest side.

2 Likes

Thanks for your message. I feel less frustrated now))

1 Like

To second what @info.victoromondi said it does happen that bugs on the Dataquest side cause this. Did you try copying and pasting the solution into the code editor? That is what’s recommended to bypass this bug (this does not mean that your code is incorrect)

4 Likes

Hi @ntokoldoshev,

Sorry about that, I have logged this issue. Thank you for bringing this up.

Best,
Sahil

2 Likes

Hi All,

I am happy to announce this issue has been fixed. :tada:
Let me know if you are still experiencing this issue.

Best,
Sahil

1 Like

Hello @Sahil , I have falling into the same issue and after reading your response, I feel it good to kindly bring to your notice that as at July 24, I am experiencing the same bug. I could have missed something though. Kindly find my code below:

fig = plt.figure(figsize=(10,6))
colors = ['red', 'blue', 'green', 'orange', 'black']
for i in range(5):
    start_index = i*12
    end_index = (i+1)*12
    subset = unrate[start_index:end_index]
    label = str(1948 + i)
    plt.plot(subset['MONTH'], subset['VALUE'], c=colors[i], label=label)
plt.legend(loc='upper left')
plt.title('Monthly Unemployment Trends, 1948-1952')
plt.xlabel('Month, Integer')
plt.ylabel('Unemployment Rate Percent')

plt.show()

image

My screen:
https://app.dataquest.io/m/143/multiple-plots/11/final-tweaks

Hope to hear from you soon.

Regards
Ezemonye

1 Like

Hi @ezems123,

This is due to a typo in your code. Please replace Unemployment Rate Percent with Unemployment Rate, Percent.

Best,
Sahil

2 Likes

Hello @Sahil, issue resolved. Thank you

1 Like

Hello,
It seems that the problem is still here :

I copied and pasted the solution to try it out but it doesn’t seem to be working.
Could you have a look at this ?
Thanks and have a good day :slight_smile:

Thomas

1 Like

It seems that I’ve tried to run plt.xlabel = “Month, Integer” and that, not closing the kernel, there’s no way of correcting it…

1 Like

Hi @thomas.jibaut,

This article will help you to resolve this issue:
How do I reload a Python library?

Best,
Sahil

I’ve found another way to deal with it.
I’ve clicked on “Reset My Progress” and went through all steps by copying and pasting the results and that worked well.
I’ll look at your url, this could save me some time :wink:
Thanks for your quick answer Sahil.

1 Like

Hi @thomas.jibaut,

I am not going to rule out the possibility that the “Reset My Progress” workaround was successful. However, there is a possibility that it may have worked due to this workaround associated with pasting the exact copy of the solution code:
https://support.dataquest.io/portal/en/kb/articles/how-to-mark-a-mission-screen-as-complete

Just in case you encounter this error on the next screen, reloading the library will solve this issue. :slight_smile:

Best,
Sahil

I’ve tried to copy and paste the exact coplete code from the solution and this didn’t work.
I’ll give a try to the library reload next time :wink:
The free week is ending tonight and I’d like to finish all the missions within this chapter in order to get the certificate :wink:
Thanks for your help.
Kind regards,
Thomas

1 Like