Interpolation (scipy.interpolate)#
Sub-package for functions and objects used in interpolation.
See the user guide for recommendations on choosing a routine, and other usage details.
Univariate interpolation#
| 
 | Create an interpolating B-spline with specified degree and boundary conditions. | 
| 
 | Piecewise cubic interpolator to fit values (C2 smooth). | 
| 
 | PCHIP shape-preserving interpolator (C1 smooth). | 
| 
 | Akima "visually pleasing" interpolator (C1 smooth). | 
| 
 | Floater-Hormann barycentric rational interpolator (C∞ smooth on real axis). | 
| 
 | Barycentric (Lagrange with improved stability) interpolator (C∞ smooth). | 
| 
 | Krogh interpolator (C∞ smooth). | 
| 
 | Piecewise cubic interpolator to fit values and first derivatives (C1 smooth). | 
Low-level data structures for univariate interpolation:
Multivariate interpolation#
Unstructured data
| 
 | Piecewise linear interpolator in N > 1 dimensions. | 
| 
 | Nearest-neighbor interpolator in N > 1 dimensions. | 
| 
 | Piecewise cubic, C1 smooth, curvature-minimizing interpolator in N=2 dimensions. | 
| 
 | Radial basis function interpolator in N ≥ 1 dimensions. | 
For data on a grid:
| 
 | Interpolator of specified order on a rectilinear grid in N ≥ 1 dimensions. | 
Low-level data structures for tensor product polynomials and splines:
1-D spline smoothing and approximation#
| 
 | Create a smoothing B-spline satisfying the Least SQuares (LSQ) criterion. | 
| 
 | Create a smoothing B-spline satisfying the Generalized Cross Validation (GCV) criterion. | 
| 
 | Create a smoothing B-spline function with bounded error, minimizing derivative jumps. | 
| 
 | Create a smoothing parametric B-spline curve with bounded error, minimizing derivative jumps. | 
| 
 | Generate knot vectors until the Least SQuares (LSQ) criterion is satified. | 
Rational Approximation#
| 
 | AAA real or complex rational approximation. | 
Interfaces to FITPACK routines for 1D and 2D spline fitting#
This section lists wrappers for FITPACK functionality for 1D and 2D smoothing splines. In most cases, users are better off using higher-level routines listed in previous sections.
1D FITPACK splines#
This package provides two sets of functionally equivalent wrappers: object-oriented and functional.
Functional FITPACK interface:
| 
 | Find the B-spline representation of a 1-D curve. | 
| 
 | Find the B-spline representation of an N-D curve. | 
| 
 | Evaluate a B-spline or its derivatives. | 
| 
 | Evaluate the definite integral of a B-spline between two given points. | 
| 
 | Find the roots of a cubic B-spline. | 
| 
 | Evaluate a B-spline and all its derivatives at one point (or set of points) up to order k (the degree of the spline), being 0 the spline itself. | 
| 
 | Compute the spline representation of the derivative of a given spline | 
| 
 | Compute the spline for the antiderivative (integral) of a given spline. | 
| 
 | Insert knots into a B-spline. | 
Object-oriented FITPACK interface:
| 
 | 1-D smoothing spline fit to a given set of data points. | 
| 
 | 1-D interpolating spline for a given set of data points. | 
| 
 | 1-D spline with explicit internal knots. | 
2D FITPACK splines#
For data on a grid:
| 
 | Bivariate spline approximation over a rectangular mesh. | 
| 
 | Bivariate spline approximation over a rectangular mesh on a sphere. | 
For unstructured data (OOP interface):
| Base class for bivariate splines. | |
| 
 | Smooth bivariate spline approximation. | 
| 
 | Smooth bivariate spline approximation in spherical coordinates. | 
| 
 | Weighted least-squares bivariate spline approximation. | 
| 
 | Weighted least-squares bivariate spline approximation in spherical coordinates. | 
For unstructured data (functional interface):
Additional tools#
| 
 | Return a Lagrange interpolating polynomial. | 
| 
 | Estimate the Taylor polynomial of f at x by polynomial fitting. | 
| 
 | Return Pade approximation to a polynomial as the ratio of two polynomials. | 
| 
 | Multidimensional interpolation on regular or rectilinear grids. | 
| 
 | Convenience function for interpolating unstructured data in multiple dimensions. | 
| 
 | Convenience function for barycentric interpolation. | 
| 
 | Convenience function for Krogh interpolation. | 
| 
 | Convenience function for pchip interpolation. | 
| 
 | Class for radial basis function interpolation of functions from N-D scattered data to an M-D domain (legacy). | 
| 
 | Interpolate a 1-D function (legacy). | 
| 
 | Class for 2D interpolation (deprecated and removed) |