python中的interp1d出错

时间:2015-09-11 10:44:22

标签: python interpolation

我在python中使用interp1d。我需要插入数据并使用此代码:

fup = interp1d(up_x, up, 'cubic')  
up = fup(x)

其中up_x,up的长度为36,x lenght为240。 但是我收到了这个错误:

File "D:\Documents\LaserInn\NN_py_algoritmo\envelope.py", line 116, in envelope
up = fup(x)

File "C:\Program Files\Anaconda3\lib\site-packages\scipy\interpolate\polyint.py", line 79, in __call__
y = self._evaluate(x)

File "C:\Program Files\Anaconda3\lib\site-packages\scipy\interpolate\interpolate.py", line 477, in _evaluate
out_of_bounds = self._check_bounds(x_new)

File "C:\Program Files\Anaconda3\lib\site-packages\scipy\interpolate\interpolate.py", line 504, in _check_bounds
raise ValueError("A value in x_new is below the interpolation "

ValueError: A value in x_new is below the interpolation range.

这个错误是什么意思?我认为up和up_x与x的不同长度不是问题。

0 个答案:

没有答案