Exercice 3 in the Practice Lab

Hello all,
I have an issue runing this code, it is under exercice 3,
all other tests for this exercice were passed successfully.

Hi @Layan_Yamani,
the use of numpy in this instance is not correct. First of all, if you want to use numpy, you should use ‘np’ because you imported it as such. In this case i don’t know what exactly you are trying to achieve with putting numpy in the middle. Try to remove it. If you want to convert your array or list to a numpy vector, then you need to use => np.array(prediction…) for example. Hope this helps!

1 Like

Once you “import numpy as np”, after that you refer to it as “np.” followed by a function name.

Also be sure you run all of the cells starting at the top of the notebook.

1 Like

I came here looking for this numpy().astype(int) phrase - I had the same and it was in the Practice Lab in a locked cell. I tried to upgrade the Lab but it was the most current. It could be how the notebooks are being distributed currently.

@ramz,
It looks like the fix for this has been checked in - very close to the time you tried upgrading the lab. Please try upgrading one more time. Sorry - you just happened to hit just the wrong timing.

This is what that section should look like now:

Thank you for the quick reply. It didn’t bother me as it was obvious but I came here to check if it had been reported already. Good to see it was updated.