【问题标题】:What does the mth argument to RectBivariateSpline do in old (0.9.0) versions of scipyRectBivariateSpline 的第 m 个参数在 scipy 的旧(0.9.0)版本中做了什么
【发布时间】:2015-10-14 01:12:48
【问题描述】:

我无法使用scipy 版本0.9.0

在那个版本中,scipy.interpolate.RectBivariateSpline.__call__ 有一个关键字参数mth。除了默认值 (mth='array') 之外,我不知道它是如何使用的,特别是支持哪些其他选项(如果有)以及它们有什么作用?

我发现的文档适用于更多最新版本,其中不推荐使用 mth 参数(支持 grid 参数)。所以这对我来说不是很有用。

【问题讨论】:

    标签: python scipy


    【解决方案1】:

    没有其他选择:

    这是函数的源代码:

    def __call__(self, x, y, mth='array'):
        """ Evaluate spline at positions x,y."""
        x = np.asarray(x)
        y = np.asarray(y)
        # empty input yields empty output
        if (x.size == 0) and (y.size == 0):
            return array([])
    
        if mth=='array':
            tx,ty,c = self.tck[:3]
            kx,ky = self.degrees
            z,ier = dfitpack.bispev(tx,ty,c,kx,ky,x,y)
            assert ier==0,'Invalid input: ier='+`ier`
            return z
        raise NotImplementedError('unknown method mth=%s' % mth)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-04
      • 1970-01-01
      • 2017-01-28
      • 1970-01-01
      • 2019-05-10
      • 2015-10-19
      • 1970-01-01
      相关资源
      最近更新 更多