Question: Import numpy and matplotlib.pyplot first in your python code Installation could be done by pip3 (e.g. pip3 install numpy) import numpy as np import matplotlib.pyplot

Import numpy and matplotlib.pyplot first in your python code Installation could be done by pip3 (e.g. pip3 install numpy") import numpy as np import matplotlib.pyplot as plt Generate data samples: generate 10 pair of data samples that satisfying Y=2*X + 50+ a small random number import numpy as np x_data = np.array([35., 38., 31., 20., 22., 25., 17., 60., 8., 60.)) y_data = 2*X_data+50+5*np.random.random(10) # updated! Thanks X could be within any range, stored as an array (using numpy array)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
