多维插值scipy.interpolate.interpn()

多维插值

最近用到多维插值,本来打算手撸,后来查了一下有现成的包,就直接拿过来用了,源码中的参数介绍不是很清楚,重新记录下。

源码

def interpn(points, values, xi, method="linear", bounds_error=True,
            fill_value=np.nan):
    """
    Multidimensional interpolation on regular or rectilinear grids.

    Strictly speaking, not all regular grids are supported - this function
    works on *rectilinear* grids, that is, a rectangular grid with even or
    uneven spacing.

    Parameters
    ----------
    points : tuple of ndarray of float, with shapes (m1, ), ..., (mn, )
        The points defining the regular grid in n dimensions. The points in
        each dimension (i.e. every elements of the points tuple) must be
        strictly ascending or descending.
       	这里传的是已知数据(也就是下面的values)的每一维的自变量值,比如总共有两维xy,x为[1,2,3],y为[10,20,30,40],那这里points为([1,2,3],[10,20,30,40])

    values : array_like, shape (m1, ..., mn, ...)
      
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值