scipy RegularGridInterpolator 维度 0 中的点必须严格升序 [英] scipy RegularGridInterpolator The points in dimension 0 must be strictly ascending
问题描述
调用时:
interpolator = scipy.interpolate.RegularGridInterpolator((X, Y, Z), data, method='linear')
我收到错误维度 0 中的点必须严格升序".
I get the error "The points in dimension 0 must be strictly ascending".
为什么点必须具有严格递增的 x 值?当然,我可以创建一个具有相同 x 值的数据的内插器,例如将坐标放入
Why must the points have strictly ascending x values? Surely I can create an interpolator with data with the same x values at time, for example with the coordinates into the data array of
0,0,0 和 0,0,1
0,0,0 and 0,0,1
(或 X = [0,0],y = [0,0] 和 Z = [0,1]
(or X = [0,0], y = [0,0] and Z = [0,1]
我一定遗漏了一些关于输入格式的信息,但看不到什么.
I must be missing something about the input format, but can't see what.
推荐答案
好吧,看起来 RegularGridInterpolator 不是我需要的,因为它需要定义网格中的所有值.LinearNDInterpolator 正是我所需要的.
Ok, it looks like RegularGridInterpolator isn't what I need, because it requires all values in the grid to be defined. LinearNDInterpolator is what I need.
这篇关于scipy RegularGridInterpolator 维度 0 中的点必须严格升序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!