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

John Travers jtravs at gmail.com
Sat Mar 26 07:49:34 EDT 2011


On Mar 22, 2011, at 11:07 AM, Peter Baek wrote:

> Hi,
> 
> 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.
> 
> Please help me find a way to evaluate an unordered vector.
> 
> Thanks,
> Peter.

Hi Peter,

This is a restriction of the underlying implementation. To evaluate an unordered vector use argsort:

i = argsort(yi2)
ii = argsort(i)
figure(3)
plot(yi1,finter_x(yi2[i],xi2)[ii])

where we have used a second argsort to re-order the output of the interpolation routine.

Hope this helps,
John




More information about the SciPy-User mailing list