Problem with eunning the codes in optional lab C1_W1_Lab02_Model_Representation_Soln

Once I


have ran the code in optional lab ( I attached the image below), the error has came across :frowning: would you please tell me why such error has occurred and what should I do to solve this problem? And… I was just wondering if you please tell me the procedure needed to run the codes in optional labs in my python :slight_smile:

Run all of the cells every time you open the notebook.

Hi, I’m new so apologies. I also received the same error message. What do you mean by “Run all of the cells every time you open the notebook.”? I did that and received error messages on all code cells. PC

Solved it. I’m assuming you left “import numpy as np” out for us to solve the problem? I’ve never written code before.

Specifically, each cell depends on the state of the notebook via all of the previous cells.

The state of the notebook is not saved when you close your browser.

So when you open the notebook to work on cell N, you must first successfully run cells 1 thru N-1.

No, that is not true. If a notebook uses numpy, it will be imported in Cell 1.

Thanks. I just figured it out. I didn’t run:

In this lab you will make use of:

  • NumPy, a popular library for scientific computing
  • Matplotlib, a popular library for plotting data

Still, was a good exercise to figure some of the problems; well, half way. Thanks again. PC

1 Like