在scipy类上执行的功能

2024-06-28 19:12:53 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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

正如我在“1d interpolation with interp1d”的类声明中所看到的,应该这样做:

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

我的问题是,上面代码中的(allCarriers)执行了什么操作?因为我是python新手,所以任何帮助都是有用的


Tags: 代码scipyabsat插值linearkindinterpolate
1条回答
网友
1楼 · 发布于 2024-06-28 19:12:53

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)

相关问题 更多 >