[SciPy-User] spline interpolators silently failing on NaNs

Michael Aye michael.aye@ucla....
Wed Dec 19 20:52:16 CST 2012


Hi,

I was just bitten by something nasty.
I am fitting some data from pandas, and as pandas deals so 
fantastically with NaNs, I forgot to check myself before handing the 
data over to InterpolatedUnivariateSpline.
To my surprise and after 2 hours of 'practising' all kinds of 
interpolations, I realised my overlook.
To my next surprise the creation of the interpolator function did not 
complain a single bit (pun not intented). Just the application of the 
interpolator to the new x-data returned only NaNs.

It is also notable, that griddata had no such problem, but I cannot use 
it because I need extrapolation as well.

Should / Could the spline interpolators maybe check for NaNs and 
complain at their existence?

Michael







More information about the SciPy-User mailing list