I have a problem with the first lab in Week 2 of Course 3 (ML Specialization). I get the following error when submitting my solution, even though all my code is correct: Cell #2. Can’t compile the student’s code. Error: NameError(“name ‘Y’ is not defined”). I think it’s because ‘Y’ is used in the second cell, but it’s defined in the third, but then how can I pass the lab? Please help. Lab id: ldsyvwyguptn.
{edited by mentor}
Hello, @tbarna22,
Welcome to this community!
Judging from your screenshot, I think it was because a code cell was removed. If you look at my screenshot below, there should be a code cell starting with #Load data
before the cell in your screenshot.
This code cell is responsible for defining Y
. If it is missing from your notebook, please follow these instructions to get a new notebook, noting that during which you will have to rename your current notebook before the system can get you a new one, and then you can copy your work from the renamed notebook.
Cheers,
Raymond
PS: We are not supposed to share assignment notebook here since it is a violation of the use of this forum, but don’t worry about it because I will remove it for you. Please only share screenshots of the full error here if you want to discuss any error.
Thank you for your quick help. I got the notebook working. Somehow the 2nd and 3rd code cells got switched, which caused the problem.
Hey, @tbarna22, it is great to hear that you solved it!
Cheers,
Raymond