Question about "Run" while going through lessons

I am working on Unit 2, and have just reached the first “run” code snippet.

I tried creating a new .py file in the code edditor tab, and running that file from the command tab, however, I seem to have reached a hanging error when I tried this.

Code executed
import numpy as np
import matplotlib.pyplot as plt
from future import division
import warnings

#data set
day = np.linspace(1,10,10)
future_day = np.linspace(1,12,12)
temp = [22, 18, 19, 26, 28, 18, 21, 27, 28, 26]

#simple regression line without optimizing the slope

m = (temp[-1] - temp[0])/(10-1)
#y = mx + b
b = temp[-1] -m

#plot the data and line
plt.figure(figsize=(10, 8))
plt.axes(xlim=(0, 15), ylim=(15, 30), autoscale_on=False)
plt.plot(future_day, (m*future_day+b))
plt.xlabel(“day”, fontsize=14)
plt.ylabel(“temperature [C]”, fontsize=14)
plt.title(“Registrered temperature [C]”, fontsize=16)

Hanging error output from the terminal
user:~/catkin_ws/src/machine_learning_course/unit2/src$ python
/usr/lib/python2.7/dist-packages/matplotlib/ UserWarning: Matplotlib is building the font cacheusing fc-list. This may take a moment.
warnings.warn(‘Matplotlib is building the font cache using fc-list. This may take a moment.’)

Okay, I figured this one out.

The notebook on the left is akin to a jupyter notebook, and it’s code is already run as soon as the page loads.

Thus, there is no need to “Run” the code again unless you have paused and / or reset the page. In which case, you would use the “run” “>|” button to execute a specific line in the book.

Hello @JohnMoody,

Yes, you are right. The notebook cells which are under a “Run” indication are meant to be executed directly on the Jupyter notebook by selecting the cell with the code and clicking on the “Run” button (it also works to press Shift+Enter in the keyboard).


Hey when I click on run or use shift enter nothing happens

Hello @aksh.shendge , in which unit are you at?