Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic, ‘cubic’ where ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of first, second or third order) or as an integer specifying the order of the spline interpolator to use. Default is ‘linear’.
kind : {‘linear’, ‘cubic’, ‘quintic’}, optional
The kind of spline interpolation to use. Default is ‘linear’.
这次所有的都是样条插值啦!
griddata
前面说了,如果不是网格数据就可以用这个函数进行插值。其中重要的参数当然是
method
method : {‘linear’, ‘nearest’, ‘cubic’}, optional
Method of interpolation. One of
nearest
return the value at the data point closest to the point of interpolation. See NearestNDInterpolator for more details.
linear
tesselate the input point set to n-dimensional simplices, and interpolate linearly on each simplex. See LinearNDInterpolator for more details.
cubic (1-D)
return the value determined from a cubic spline.
cubic (2-D)
return the value determined from a piecewise cubic, continuously differentiable (C1), and approximately curvature-minimizing polynomial surface. See CloughTocher2DInterpolator for more details.
__call__(x[, nu, ext]) Evaluate spline (or its nu-th derivative) at positions x.
antiderivative([n]) Construct a new spline representing the antiderivative of this spline.
derivative([n]) Construct a new spline representing the derivative of this spline.
derivatives(x) Return all derivatives of the spline at the point x.
get_coeffs() Return spline coefficients.
get_knots() Return positions of (boundary and interior) knots of the spline.
get_residual() Return weighted sum of squared residuals of the spline approximation: sum((w[i] * (y[i]-spl(x[i])))**2, axis=0).
integral(a, b) Return definite integral of the spline between two given points.
roots() Return the zeros of the spline.
set_smoothing_factor(s) Continue spline computation with the given smoothing factor s and with the knots found at the last call.