iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
SciPy interpolation is a set of methods, not one universal function. Start with how your samples are arranged: use a dedicated interpolator for one-dimensional data, RegularGridInterpolator (or its convenience wrapper interpn) for values on a rectilinear grid, and tools such as griddata or RBFInterpolator for scattered points. Then choose based on the smoothness or shape you need, and decide explicitly how to handle points outside the sampled domain.
Choose by the geometry of your data
Interpolation estimates values between known samples. The right SciPy API depends first on whether those samples form a line, a grid, or an irregular cloud of points.
| Data layout | Starting point | What to consider |
|---|---|---|
| One-dimensional samples | CubicSpline, PchipInterpolator, or make_interp_spline |
Choose among smoothness, shape preservation, and spline behavior; set and validate boundary behavior. |
| Multidimensional values on a rectilinear grid | RegularGridInterpolator or interpn |
Works with axes that can have unequal spacing and different numbers of points. Available strategies include nearest, linear, and odd-degree tensor-product splines. |
| Scattered, unstructured multidimensional points | griddata or RBFInterpolator |
Consider interpolation method, coordinate scales, extrapolation, and cost for larger datasets. |
How do I interpolate one-dimensional data?
For samples along one axis, select a specific interpolator according to the shape and smoothness you want rather than reaching automatically for a generic function.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Use CubicSpline for smooth cubic pieces
CubicSpline constructs piecewise cubic polynomials with continuous first and second derivatives. This is useful when a smooth curve is appropriate, but smoothness alone does not guarantee the curve respects every shape constraint in the measurements.
#1 Best Overall
Use PchipInterpolator when avoiding overshoot matters
PchipInterpolator is a shape-preserving, monotone option described in SciPy’s tutorial as non-overshooting. Consider it when preserving monotonicity between samples is more important than obtaining the same smoothness characteristics as a conventional cubic spline.
Use make_interp_spline for spline choices
make_interp_spline is another current one-dimensional option when you need a spline interpolator and want to choose its spline behavior. See the SciPy one-dimensional interpolation tutorial for the available choices and boundary options.
Rank #2
For new code, avoid starting with interp1d
SciPy labels interp1d legacy and says it “will no longer receive updates.” It remains relevant when maintaining existing code, but for a new implementation choose a specific modern interpolator instead. See the interp1d API reference.
How do I interpolate data on a regular grid?
For multidimensional values sampled on a rectilinear grid, use RegularGridInterpolator. Rectilinear means each coordinate axis is specified by its own one-dimensional array; the axes need not have equal spacing or the same number of points. Its supported approaches include nearest, linear, and odd-degree tensor-product spline strategies. interpn provides a convenience interface to this class.
Do not use griddata just because it sounds like a general grid interpolator. SciPy directs users with data on a full or regular grid to RegularGridInterpolator or interpn instead. See the RegularGridInterpolator reference and the interpn reference.
How do I interpolate scattered data in Python?
For multidimensional samples at irregularly located points, griddata is a convenience interface with nearest, linear, and cubic methods. Its linear method triangulates the input into simplices; the cubic method is available in two dimensions. If these choices do not fit your problem, RBFInterpolator is another option, including for smoothing.
These approaches are for scattered points, not a substitute for regular-grid interpolation. See SciPy’s tutorial on interpolation of unstructured data and the griddata API reference.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteCheck coordinate scaling
Scattered interpolation can produce numerical artifacts when coordinates have very different magnitudes or incommensurate units. Rescale coordinates where appropriate; griddata also provides rescale=True. Rescaling is a numerical adjustment, not a replacement for choosing meaningful units or checking whether the result makes sense for the underlying problem.
Best Value
Account for RBF cost and extrapolation
The coefficient solve for RBFInterpolator has memory use that grows quadratically with the number of data points. SciPy’s documentation warns that it can become impractical for more than about a thousand points; this is a practical documentation caveat, not a benchmark for every workload. The neighbors option limits each evaluation to nearby data points. SciPy’s tutorial also cautions against relying on RBF extrapolation outside the observed range. See the RBFInterpolator reference.
What happens outside the sampled domain?
Interpolation inside the data range does not establish that an estimate beyond that range is meaningful. Boundary behavior varies by interpolator and its settings: one-dimensional spline routines, for example, expose extrapolation-related parameters. Before using results outside the samples, check the selected routine’s out-of-bounds behavior and validate whether extending the data is justified for your application.
Quick Recap
A practical method-selection checklist
- Identify the layout. Use a one-dimensional interpolator for 1-D samples,
RegularGridInterpolatororinterpnfor a rectilinear grid, and scattered-data tools for unstructured points. - Decide what the estimate must preserve. For 1-D data, consider whether smooth cubic pieces or monotone, non-overshooting behavior matters. For grids and scattered points, select among the documented methods that match the desired behavior.
- Set expectations at boundaries. Inspect out-of-bounds and extrapolation options instead of assuming an interpolator is safe beyond the observed range.
- For scattered points, inspect coordinate units and scale. Rescale where appropriate and evaluate whether the resulting interpolation is numerically and physically plausible.
- Check version-specific API status. The SciPy v1.18.0 documentation identifies
interp1das legacy andinterp2das deprecated or removed; confirm the reference for the SciPy version used by your project before migrating older code. See the interp2d API reference.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

