Die docs in scipy.interpolate.interp1d (v0.17.0) folgendes sagen für die optionale fill_value Argument:Hindurchleiten eines Tupels in scipy.interpolate.interp1d Ergebnisse in Valueerror fill_value
fill_value : ... If a two-element tuple, then the first element is used as a fill value for x_new < x[0] and the second element is used for x_new x[-1].
So passieren I a zwei-Element tupe in diesem Code:
N=100
x=numpy.arange(N)
y=x*x
interpolator=interp1d(x,y,kind='linear',bounds_error=False,fill_value=(x[0],x[-1]))
r=np.arange(1,70)
interpolator(np.arange(1,70))
Aber es wirft Valueerror:
ValueError: shape mismatch: value array of shape (2,) could not be broadcast to indexing result of shape (0,1)
Kann mir bitte jemand zeigen, was mache ich hier falsch? Vielen Dank im Voraus für jede Hilfe.
Danke eine Million, und mir war np.interp nicht bekannt – jmborr