bundles / scipy 1.17.1 / scipy / interpolate / _interpolate / PPoly
class
scipy.interpolate._interpolate:PPoly
Signature
class PPoly ( c , x , extrapolate = None , axis = 0 ) Members
Summary
Piecewise polynomial in the power basis.
Extended Summary
The polynomial between x[i] and x[i + 1] is written in the local power basis
S = sum(c[m, i] * (xp - x[i])**(k-m) for m in range(k+1))where k is the degree of the polynomial.
Parameters
c: ndarray, shape (k+1, m, ...)Polynomial coefficients, degree
kandmintervals.x: ndarray, shape (m+1,)Polynomial breakpoints. Must be sorted in either increasing or decreasing order.
extrapolate: bool or 'periodic', 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. Default is True.
axis: int, optionalInterpolation axis. Default is zero.
Attributes
x: ndarrayBreakpoints.
c: ndarrayCoefficients of the polynomials. They are reshaped to a 3-D array with the last dimension representing the trailing dimensions of the original coefficient array.
axis: intInterpolation axis.
Methods
__call__derivativeantiderivativeintegratesolverootsextendfrom_splinefrom_bernstein_basisconstruct_fast
Notes
High-order polynomials in the power basis can be numerically unstable. Precision problems can start to appear for orders larger than 20-30.
Array API Standard Support
PPoly 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
- BPoly
piecewise polynomials in the Bernstein basis
Aliases
-
scipy.interpolate.PPoly