class scipy.interpolate.RegularGridInterpolator(points, values, method='linear', bounds_error=True, fill_value=nan)[source]

Interpolation on a regular grid in arbitrary dimensions

The data must be defined on a regular grid; the grid spacing however may be uneven. Linear and nearest-neighbour interpolation are supported. After setting up the interpolator object, the interpolation method (linear or nearest) may be chosen at each evaluation.

New in version 0.14.

Parameters :

points : tuple of ndarray of float, with shapes (m1, ), ..., (mn, )

The points defining the regular grid in n dimensions.

values : array_like, shape (m1, ..., mn, ...)

The data on the regular grid in n dimensions.

method : str

The method of interpolation to perform. Supported are “linear” and “nearest”. This parameter will become the default for the object’s __call__ method.

bounds_error : bool, optional

If True, when interpolated values are requested outside of the domain of the input data, a ValueError is raised. If False, then fill_value is used.

fill_value : number, optional

If provided, the value to use for points outside of the interpolation domain. If None, values outside the domain are extrapolated.

See also

Nearest neighbour interpolation on unstructured data in N dimensions
Piecewise linear interpolant on unstructured data in N dimensions


Contrary to LinearNDInterpolator and NearestNDInterpolator, this class avoids expensive triangulation of the input data by taking advantage of the regular grid structure.


[R38]Python package regulargrid by Johannes Buchner, see
[R39]Trilinear interpolation. (2013, January 17). In Wikipedia, The Free Encyclopedia. Retrieved 27 Feb 2013 01:28.
[R40]Weiser, Alan, and Sergio E. Zarantonello. “A note on piecewise linear and multilinear table interpolation in many dimensions.” MATH. COMPUT. 50.181 (1988): 189-196.


__call__(xi[, method]) Interpolation at coordinates