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
warnings.filterwarnings(‘ignore’)
#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] -m10
#plot the data and line
plt.figure(figsize=(10, 8))
plt.axes(xlim=(0, 15), ylim=(15, 30), autoscale_on=False)
plt.scatter(day,temp)
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)
plt.show()
"
Hanging error output from the terminal
"
user:~/catkin_ws/src/machine_learning_course/unit2/src$ python data_stuff.py
/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: 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.’)
"