griddata运行时错误 - Python/SciPy(插值)

Pro*_*erp 3 python interpolation scipy

我使用scipy的griddate函数进行插值.

什么以下错误消息意味着,当蟒蛇是执行的GridData功能出现?

File "C:\Python25\lib\site-packages\scipy\interpolate\ndgriddata.py", line 182, in griddata
ip = LinearNDInterpolator(points, values, fill_value=fill_value)
File "interpnd.pyx", line 192, in interpnd.LinearNDInterpolator.__init__ (scipy\interpolate\interpnd.c:2524)
File "qhull.pyx", line 917, in scipy.spatial.qhull.Delaunay.__init__ (scipy\spatial\qhull.c:4030)
File "qhull.pyx", line 170, in scipy.spatial.qhull._construct_delaunay (scipy\spatial\qhull.c:1269)
RuntimeError: Qhull error
Run Code Online (Sandbox Code Playgroud)

pv.*_*pv. 7

这通常意味着您传入的点集不能进行三角测量.可能发生这种情况的一些常见情况:

  • 您有2D数据,但所有点都在一条线上.在这种情况下,没有对非简并三角形的数据进行三角测量.
  • 你有3D数据,但是所有的点都在一个平面上,所以没有分解为非退化的四面体.等等更高的尺寸.

在这些情况下,插值也没有意义,所以这个失败不是错误的指示,而是错误的使用griddata.

通常情况下,Qhull会打印有关stderr出错的其他信息,因此请检查程序输出以查看其内容.