[Scipy-tickets] [SciPy] #1824: scipy.insterpolate's splrep function fails with certain combinations of knots and number of datapoints

SciPy Trac scipy-tickets@scipy....
Sat Jan 26 10:28:43 CST 2013


#1824: scipy.insterpolate's splrep function fails with certain combinations of
knots and number of datapoints
-------------------------------+--------------------------------------------
 Reporter:  nespinoza          |       Owner:  pv         
     Type:  task               |      Status:  new        
 Priority:  normal             |   Milestone:  Unscheduled
Component:  scipy.interpolate  |     Version:  0.10.1     
 Keywords:                     |  
-------------------------------+--------------------------------------------

Comment(by nespinoza):

 I created a way around the problem. It probably has to do with a low
 number of datapoints to fit between two knots, so what I did was to
 replace the line where I create the number of knots with:

 idx_knots =
 (np.arange(1,len(x)-1,(len(x)-2)/np.double(nknots))).astype('int')
 knots = xx[idx_knots]

 In that way, I ensure that there are enough datapoints between the knots
 because I play with the indices of the x vector.

 Cheers

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


More information about the Scipy-tickets mailing list