我正在开发一个使用NumPy
and的 Python 项目SciPy
。我有以下内容:
x = numpy.arange(-5,5,0.01)
y = numpy.arange(-5,5,0.01)
x
我也有这样的y
功能
# fxy = function of x and y in a grid
# fxy.shape = (y.shape[0], x.shape[0])
我想进行插值fxy
,使函数值位于x
或分开的y
点,0.0001
即0.001
我想评估函数fxy
finer_x = numpy.arange(-5,5,0.0001)
finer_y = numpy.arange(-5,5,0.0001)
# finer_fxy = function of finer_x and finer_y in a grid
# finer_fxy.shape = (finer_y.shape[0], finer_x.shape[0])
我一直在尝试使用bisplrep
andinterp2d
函数,scipy.interpolate
但我得到了
File "/usr/lib/python2.7/dist-packages/scipy/interpolate/fitpack.py", line 873, in bisplrep
tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
MemoryError
和
OverflowError: Too many data points to interpolate
分别使用这些功能。创建插值数据的最佳方法是什么?