python - Extrapolating with a single data point -
is there function extrapolating in numpy?
i tried using interp of course interpolates between range of values , not outside range of values.
so example have x-values between 1 , 8, inclusive, , each x-value, have corresponding y-value , want find y-value when x-value 0
import numpy np x = np.arange(1,8,1) y = np.array((10,20,30,40,50,60,70)) np.interp(0,x,y) is there function interp??
scipy.interpolate.interp1d allows extrapolation.
import numpy np scipy import interpolate x = np.arange(1,8,1) y = np.array((10,20,30,40,50,60,70)) interpolate.interp1d(x, y, fill_value='extrapolate') hope answers question
Comments
Post a Comment