son*_*olo 3 python interpolation numpy scipy
我试图实例化Scipy Interpolate RectBivariateSpline,如下所示:
import numpy as np
from scipy.interpolate import RectBivariateSpline
x = np.array([1,2,3,4])
y = np.array([1,2,3])
vals = np.array([
[4,1,4],
[4,2,3],
[3,7,4],
[2,4,5]
])
print(x.shape) # (4,)
print(y.shape) # (3,)
print(vals.shape) # (4, 3)
rect_B_spline = RectBivariateSpline(x, y, vals)
Run Code Online (Sandbox Code Playgroud)
但是,它会返回此错误:
Traceback (most recent call last):
File "path/file", line 15, in <module>
rect_B_spline = RectBivariateSpline(x, y, vals)
File "path/file", line 1061, in __init__
ye, kx, ky, s)
dfitpack.error: (my>ky) failed for hidden my: regrid_smth:my=3
Run Code Online (Sandbox Code Playgroud)
将不胜感激任何关于dfitpack错误描述以及如何解决的线索.
| 归档时间: |
|
| 查看次数: |
1636 次 |
| 最近记录: |