►
Run
>>> import numpy as np >>> from scipy import interpolate >>> x = np.arange(0, 10) >>> y = np.exp(-x/3.0) >>> f = interpolate.interp1d(x, y) >>> x array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >>> y array([1. , 0.71653131, 0.51341712, 0.36787944, 0.26359714, 0.1888756 , 0.13533528, 0.09697197, 0.06948345, 0.04978707]) >>> f(0.5) array(0.85826566) >>> f(1.5) array(0.61497421) >>>
Output