使用SciPy 2D插补器时出错

时间:2015-08-17 19:34:33

标签: python scipy interpolation

我有Sub Typed() 'get a reference to the registry key Dim regKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Internet Explorer\TypedURLs", True) ' enumerate the list of values under that registry key For Each value In regKey.GetValueNames ' add to listbox ListBox1.Items.Add(regKey.GetValue(value)) ' delete the value from registry regKey.DeleteValue(value) Next End Sub 插值的以下代码:

2D

当我为新数据点运行此插补器时:

myInterpolator = NearestNDInterpolator(XY_product, grid_data)

我收到以下错误:

new_grid_data = myInterpolator(new_XY)

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

以下是xi = self._check_call_shape(xi)的说明,它阐明了错误的来源:

def _check_call_shape(self, xi):
    xi = np.asanyarray(xi)
    if xi.shape[-1] != self.points.shape[1]:
        raise ValueError("number of dimensions in xi does not match x")
    return xi

这基本上意味着xi.shape[-1]应该等于self.points.shape[1]