[SciPy-user] spline <-> NaN

Alexander Kollmann kollmann at telbiomed.at
Tue May 23 15:55:08 EDT 2006


Hi,

 

How can I calculate the spline from an input array (time-series) which
contains 'NaN'. I'm using the "splprep" and the "splev" function.

 

Without NaN everything works fine but in the case of NaN the spline
algoritms seems not to work and there is also no error message. 

 

Example:

 

y = array([113.0, 112.0, 113.0, 111.0, 110.0, NaN, NaN, NaN, NaN, NaN,
NaN, 111.0, 108.0, 109.0])

max = len(y)

x = arange(0,max,1)

spline_coeffs=interpolate.splrep(x,y,s=0)

y_spline=interpolate.splev(x,spline_coeffs,der=0)

 

Thanks, Alex 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20060523/c2be6590/attachment.html>


More information about the SciPy-User mailing list