bundles / scipy 1.17.1 / scipy / interpolate / _cubic / CubicHermiteSpline
class
scipy.interpolate._cubic:CubicHermiteSpline
source: /scipy/interpolate/_cubic.py :74
Signature
class CubicHermiteSpline ( x , y , dydx , axis = 0 , extrapolate = None ) Members
Summary
Piecewise cubic interpolator to fit values and first derivatives (C1 smooth).
Extended Summary
The result is represented as a PPoly instance.
Parameters
x: array_like, shape (n,)1-D array containing values of the independent variable. Values must be real, finite and in strictly increasing order.
y: array_likeArray containing values of the dependent variable. It can have arbitrary number of dimensions, but the length along
axis(see below) must match the length ofx. Values must be finite.dydx: array_likeArray containing derivatives of the dependent variable. It can have arbitrary number of dimensions, but the length along
axis(see below) must match the length ofx. Values must be finite.axis: int, optionalAxis along which
yis assumed to be varying. Meaning that forx[i]the corresponding values arenp.take(y, i, axis=axis). Default is 0.extrapolate: {bool, 'periodic', None}, optionalIf bool, determines whether to extrapolate to out-of-bounds points based on first and last intervals, or to return NaNs. If 'periodic', periodic extrapolation is used. If None (default), it is set to True.
Attributes
x: ndarray, shape (n,)Breakpoints. The same
xwhich was passed to the constructor.c: ndarray, shape (4, n-1, ...)Coefficients of the polynomials on each segment. The trailing dimensions match the dimensions of
y, excludingaxis. For example, ifyis 1-D, thenc[k, i]is a coefficient for(x-x[i])**(3-k)on the segment betweenx[i]andx[i+1].axis: intInterpolation axis. The same axis which was passed to the constructor.
Methods
__call__derivativeantiderivativeintegratesolveroots
Notes
If you want to create a higher-order spline matching higher-order derivatives, use BPoly.from_derivatives.
Array API Standard Support
CubicHermiteSpline has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable SCIPY_ARRAY_API=1 and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.
==================== ==================== ==================== Library CPU GPU ==================== ==================== ==================== NumPy ✅ n/a CuPy n/a ⛔ PyTorch ✅ ⛔ JAX ⚠️ no JIT ⛔ Dask ⛔ n/a ==================== ==================== ====================
See
dev-arrayapifor more information.
See also
- Akima1DInterpolator
Akima 1D interpolator.
- CubicSpline
Cubic spline data interpolator.
- PPoly
Piecewise polynomial in terms of coefficients and breakpoints
- PchipInterpolator
PCHIP 1-D monotonic cubic interpolator.
Aliases
-
scipy.interpolate.CubicHermiteSpline