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

Pauli Virtanen pav at iki.fi
Wed Apr 24 03:20:34 EDT 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