[SciPy-User] Fix for griddata unsorted data

Wolfgang Kerzendorf wkerzendorf at googlemail.com
Fri Mar 18 09:55:06 EDT 2011


Dear all,

I realized that for the LinearNDInterpolator to work the data needs to 
be sorted. This is explained in griddata, but unfortunatley is not 
included in the LinearNDInterpolator description. It would be great if 
that would be updated. I also think that (as most things in scipy) it 
should just work.

Here's my proposed fix. Before giving the points and values to qhull we 
do this:

sortIDx = np.lexsort(points.transpose()[::-1])
LinearNDInterpolator(points[sortIDx], newValues[sortIDx])

I think that this should work.

I really think that Qhull is an amazing addition to scipy. It basically 
sped up my computations by orders of magnitude.

While playing around with Qhull, I stumbled across another gem for 
numerics: PyMinuit. It is an extremely good optimizer, very easy to use 
and I was wondering if that would be interesting to include in scipy.

Cheers
     Wolfgang



More information about the SciPy-User mailing list