scipy RegularGridInterpolator 维度 0 中的点必须严格升序 [英] scipy RegularGridInterpolator The points in dimension 0 must be strictly ascending

查看:96
本文介绍了scipy RegularGridInterpolator 维度 0 中的点必须严格升序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调用时:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆