[SciPy-User] spline interpolators silently failing on NaNs

Michael Aye michael.aye at ucla.edu
Wed Dec 19 21:52:16 EST 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