Jupyter notebook- no output

I am taking MLS course 1 on Coursera. On running the pre-written code cells in the optional lab, I do not get any output and it shows : NameError: name ‘np’ is not defined

Do I have to install any software for execution of the code?

Did you execute the very first cell? that’s the one that contains the imports of libraries. The error “name ‘np’ is not defined” sounds like numpy was not imported.

Can you try running all cells from top to bottom again?


Sorry, It seems I did not execute the first cell that imports libraries. Now, after executing that cell, I am able to get the outputs.

Thank you so much Sir!!

Note that you will have to run all of the cells every time you open the notebook.

Thank you Sir! Will work on that.