[Scipy-tickets] [SciPy] #1488: scipy.interpolate.lagrange issue

SciPy Trac scipy-tickets@scipy....
Wed Aug 3 13:58:54 CDT 2011


#1488: scipy.interpolate.lagrange issue
-------------------------------+--------------------------------------------
 Reporter:  kvnsmth            |       Owner:  somebody   
     Type:  defect             |      Status:  new        
 Priority:  normal             |   Milestone:  Unscheduled
Component:  scipy.interpolate  |     Version:  0.9.0      
 Keywords:                     |  
-------------------------------+--------------------------------------------
 This method seems to choke when only 3 points are given.

 {{{
 def test_numpy():
     import scipy.interpolate as interp
     import numpy as np
     import pylab
     x = np.linspace(0,3.14,3)
     y = np.sin(x)
     lag = interp.lagrange(x=x, w=y)
     pylab.plot(x,y,'o')

     yf = np.zeros(101)
     xf = np.linspace(min(x)-1, max(x)+1, 101)
     for i in xrange(len(yf)):
         for j in xrange(len(lag)):
             yf[i] += xf[i]**(j) * lag[j]

     pylab.plot(xf,yf,'-')
     pylab.show()
 }}}

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


More information about the Scipy-tickets mailing list