[SciPy-User] Problem with scipy.interpolate.RectBivariateSpline

Pauli Virtanen pav@iki...
Wed Mar 23 07:24:50 CDT 2011


Wed, 23 Mar 2011 12:10:02 +0100, Peter Baek wrote:
> I find it strange that scipy.interpolate.RectBivariateSpline cannot
> evaluate a random vector. When i evaluate an ordered vector using e.g.
> linspace it works fine, but when i try a random vector it crashes.

The algorithm is made for regridding, and handles only sorted grids.

> Please help me find a way to evaluate an unordered vector.

Sort the entries first.

Or, if you want to evaluate the function only at the given points, rather 
than on a grid, use

	finter_x.ev(yi2, xi2)

The two coordinate arrays need either to be of the same shape, e.g. via

	yi2, xi2 = np.broadcast_arrays(yi2,xi2)

-- 
Pauli Virtanen



More information about the SciPy-User mailing list