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

被折叠的 条评论
为什么被折叠?



