[SciPy-user] interpn

Travis E. Oliphant oliphant@enthought....
Wed Jun 4 10:58:39 CDT 2008


lorenzo bolla wrote:
> Hello all!
>
> Is there, in scipy or numpy, a function similar to Matlab's interpn?
> >From Matlab's help on interpn:
> "VI = interpn(X1,X2,X3,...,V,Y1,Y2,Y3,...) interpolates to find VI,
> the values of the underlying multidimensional function V at the points
> in the arrays Y1, Y2, Y3, etc. For an n-dimensional array V, interpn
> is called with 2*N+1 arguments. Arrays X1, X2, X3, etc. specify the
> points at which the data V is given. Out of range values are returned
> as NaNs. ..."
>
> Basically, I've got a function from R^n to R. I know its value in a
> set of points in R^n. I want to interpolate them so as to be able to
> evaluate the function in any R^n point.
>   

scipy.ndimage has something called map_coordinates which (I think) can 
do what you want, but it's interface is a bit more complicated than 
interpn.

-Travis




More information about the SciPy-user mailing list