[SciPy-user] spline problem
Stefan van der Walt
Mon Sep 10 02:32:27 CDT 2007
On Fri, Sep 07, 2007 at 03:07:28PM +0200, Peter Bienstman wrote:
> I'm trying to do spline interpolation of my data. When I try the final example
> of http://www.scipy.org/Cookbook/Interpolation, everything works fine.
> However, as soon as I adapt it to use my own data, I get this
> Traceback (most recent call last):
> File "test.py", line 26, in ?
> tckp,u = splprep([x,y],s=s,k=k,nest=-1,quiet=0)
> File "/usr/lib64/python2.4/site-packages/scipy/interpolate/fitpack.py", line
> 223, in splprep
> SystemError: error return without exception set
Your code contains duplicate data points. You can find them by doing
mask = ((diff(x) == 0) & (diff(y) == 0))
If I change or remove those values, everything works well (see
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1798 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20070910/ec3e051b/attachment.py
More information about the SciPy-user