import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
year = np.array([1986, 1988, 1990, 1992, 1994, 1996])
price= np.array([133.5, 132.2, 138.7, 141.5, 137.6, 144.2])
M = np.vander(year)
a = np.linalg.solve(M,price)
x = np.linspace(1986,1996,200)
p = np.polyval(a,x)
plt.plot(year,price,'o',x,p,'-')
year = np.array([1986, 1988, 1990, 1992, 1994, 1996])
year = year / year.mean()
price= np.array([133.5, 132.2, 138.7, 141.5, 137.6, 144.2])
M = np.vander(year)
a = np.linalg.solve(M,price)
x = np.linspace(year.min(), year.max(),200)
p = np.polyval(a,x)
plt.plot(year,price,'o',x,p,'-')