在 scipy 类上执行的功能



我正在使用 1d 插值和 Scipy 的 interp1d。 我正在使用的以下代码,

Hest_abs = scipy.interpolate.interp1d(pilotCarriers, abs(Hest_at_pilots), kind='linear')(allCarriers)

正如我在"带有 interp1d 的 1d 插值"的类声明中看到的,应该这样做:

class scipy.interpolate.interp1d(x, y, kind='linear', axis=-1, copy=True, bounds_error=None, fill_value=nan, assume_sorted=False)

我的查询是使用上述代码中的(allCarriers(执行的操作是什么?由于我是 python 的新手,任何帮助都会很有用。

https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html

class scipy.interpolate.interp1d(x, y, kind='linear', axis=-1, copy=True, bounds_error=None, fill_value=nan, assume_sorted=False)[source]
Interpolate a 1-D function.
x and y are arrays of values used to approximate some function 
f: y = f(x). This class returns a function whose call method uses 
interpolation to find the value of new points.
Methods
__call__(self, x)
Evaluate the interpolant

所以

X = scipy.interpolate.interp1d(pilotCarriers, abs(Hest_at_pilots), kind='linear')

创建一个callable的对象,即可以用作函数:

Hest_abs = X(allCarriers)

最新更新