Problem with Practice Lab: Advice for Applying Machine Learning

Hello everyone,

I run the code and results are coming out as expected, still can’t pass the assignement because I got the following error code:
“Cell #35. Can’t compile the student’s code. Error: NameError(“name ‘_’ is not defined”)”

Can you please help me to fix? I have already made it 6 times with no success.


Check on your code, apparently there is. variable ‘_’ that is being used but is not defined previously, thats what the error says!

Thanks for getting back to me, but I can’t find it! Once I run the Jupyther notebook with my code everything runs smoothly. Only the automatic script valuation tool from Coursera sees this problem

How can I find the cell 35? starting from where?

Hello @alessio321,

You may click “Restart and run all”, and after it reaches the 35th cell, you will see 35 next to the cell and very likely an error message similar to the one in your last screenshot.



1 Like

Thanks for your feedback.
I did as you suggested and I can’t find the error (no error message shown).

How can I identify the cell 35?

These are the results in the whole document for „_“:

Hello @alessio321

First, make sure the name of your assignment notebook is “C2_W3_Assignment”.


Second, do this again:

Then, WAIT for, let’s say, 20 seconds.

Then, can you see there is a In [1] here?


That tells you that it is the 1st code cell successfully run by Jupyter.

Then, scroll down until you see the next code cell, and if it does not show a number on the left hand side of it like the above one, then WAIT until it finished running, and there will be a number two showing there like In [2].


That tells you that it is the 2nd code cell successfully run by Jupyter.

Can you repeat this process, very importantly including the “waiting” part, until ALL of the code cells finish running, and that you see a number displaying on each and every code cell?

Finally, you go through the numbers, locate In [35], and you find the 35th cell.

If your 35th cell displays no error, could you please share a screenshot of the whole cell, including the part that shows In [35]?


I just did a reset of the whole notebook. Applied the new code and now looks to work. Probably I slightly changed by mistake somewhere a code line and this resulted to the error.


That’s great, @alessio321! Whichever way works is fine! And now, I hope you know too how to locate a code cell next time because it is the language of the autograder.