[Scipy-tickets] [SciPy] #239: scipy.interpolate.splprep creates wrong structure: cannot be used with splev

SciPy scipy-tickets at scipy.net
Wed Aug 2 07:47:02 CDT 2006


#239: scipy.interpolate.splprep creates wrong structure: cannot be used with
splev
-------------------------------+--------------------------------------------
 Reporter:  tnoo               |       Owner:  somebody
     Type:  defect             |      Status:  new     
 Priority:  high               |   Milestone:          
Component:  scipy.interpolate  |     Version:  devel   
 Severity:  critical           |    Keywords:          
-------------------------------+--------------------------------------------
 The following code results in an error. splprep creates a tuple of length
 2 instead 3, so that splev cannot evaluate it.

 -------------
 import scipy as S
 import scipy.interpolate

 x = S.array([[0.,0.,0.],
             [1.,1.,0.],
             [1.5,0.9,0.5],
             [2.,0.,1.],]
             )

 sp = scipy.interpolate.splprep(x.transpose())
 print scipy.interpolate.splev([0.], sp)
 -------------
 ---------------

 exceptions.ValueError                                Traceback (most
 recent call last)

 /home/tinu/projects/lbie/python/<ipython console>

 /tmp/python-5096nEG.py
       7             [2.,0.,1.],]
       8             )
       9
      10 sp = scipy.interpolate.splprep(x.transpose())
 ---> 11 print scipy.interpolate.splev([0.], sp)

 /usr/lib/python2.4/site-packages/scipy/interpolate/fitpack.py in splev(x,
 tck, der)
     406            representing the curve in N-dimensional space.
     407     """
 --> 408     t,c,k=tck
     409     try:
     410         c[0][0]

 ValueError: need more than 2 values to unpack
 ---------------

-- 
Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/239>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list