[SciPy-User] 2D interpolation on random points of a function defined on a regular grid

Pauli Virtanen pav@iki...
Wed Apr 24 02:20:34 CDT 2013


Antonio <tritemio <at> gmail.com> writes:
[clip]
> import scipy.interpolate as SI
> interp_fun = SI.interp2d(xd,yd,data)
> z = interp_fun(x,y)

Use

interp_fun = SI.RectBivariateSpline(xd, yd, data.T)
z = interp_fun.ev(x, y)

Note that this expects the data be in (nx, ny) shape,
hence the transpose.

-- 
Pauli Virtanen



More information about the SciPy-User mailing list