gpt4 book ai didi

python - 在 SciPy 中,什么是 'slinear' 插值?

转载 作者:太空狗 更新时间:2023-10-29 17:47:46 25 4
gpt4 key购买 nike

我找不到解释 in the documentation或在线任何地方。 “线性”代表什么,它有什么作用?

最佳答案

查看scipy/interpolate/interpolate.py的源码,slinearspline顺序 1

if kind in ['zero', 'slinear', 'quadratic', 'cubic']:
order = {'nearest': 0, 'zero': 0,'slinear': 1,
'quadratic': 2, 'cubic': 3}[kind]
kind = 'spline'

...

if kind in ('linear', 'nearest'):
# Make a "view" of the y array that is rotated to the interpolation
# axis.
minval = 2
if kind == 'linear':
self._call = self._call_linear
elif kind == 'nearest':
self.x_bds = (x[1:] + x[:-1]) / 2.0
self._call = self._call_nearest
else:
minval = order + 1
self._call = self._call_spline
self._spline = splmake(x, y, order=order)

由于 splmake 的文档状态:

def splmake(xk, yk, order=3, kind='smoothest', conds=None):
"""
Return a representation of a spline given data-points at internal knots
...

关于python - 在 SciPy 中,什么是 'slinear' 插值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17572390/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com