[SciPy-user] Example of how to use B-splines for interpolation

Travis Oliphant oliphant.travis at ieee.org
Tue Jan 31 14:18:04 CST 2006

Andrew Straw wrote:

>Hi Travis,
>Thanks for your work on this--it's very useful to me.
>I found 2 issues. I'm including a test and a potential fix for the first
>issue, which seems to be an end-point problem. Under some circumstances,
>the endpoints aren't properly detected. I didn't attempt to comprehend
>everything going on in this function, but the patch I made apparently
>works. Please review it and apply it if it's acceptable.
Thanks for the patch.  I'm doing something a little simpler now (the 
clip method).

>The second issue is that the x array cannot be integers (a TypeError
>gets raised). There doesn't seem to be any good reason for this (why
>can't splines exist over integers?), so I submit that it's also a bug.
>Unfortunately, that didn't look as easy for me to fix, so I leave it for
I'm not getting any errors for x being integers in the code you gave, 
perhaps you mean that when the new array to evaluate over is an array of 
integers we get errors, which is true and has been fixed.


More information about the SciPy-user mailing list