returns a function whose call method uses interpolation to find the value of new points
1 2 3 4 5 6 7 8 9 10 11 12 13
from scipy import interpolate import matplotlib.pyplot as plt %matplotlib inline
x = np.arange(0, 10) y = np.exp(-x/3.0) f = interpolate.interp1d(x, y)
xnew = np.arange(0, 9, 0.1) ynew = f(xnew) # use interpolation function returned by `interp1d` print(ynew) plt.plot(x, y, 'o', xnew, ynew, '-') plt.show()