[Scipy-tickets] [SciPy] #305: Nearest neighbour interpolation for scipy.interpolate

SciPy scipy-tickets@scipy....
Sun May 27 05:16:09 CDT 2007

#305: Nearest neighbour interpolation for scipy.interpolate
 Reporter:  togr                   |        Owner:  timl    
     Type:  enhancement            |       Status:  assigned
 Priority:  normal                 |    Milestone:          
Component:  scipy.interpolate      |      Version:  0.5.2   
 Severity:  minor                  |   Resolution:          
 Keywords:  nearest interpolation  |  
Comment (by togr):

 Okay, I've looked at the svn repository and found even more substantial
 I downloaded rev. 3049 of interpolate.py and I've tried making my
 implementation of nearest neighbour interpolation in a form which I
 '''think''' should work against this revision.  Unfortunately, I don't
 have a way to test this.

 The script I have used for testing is below.  If there is a framework to
 which I can add an automatically run test case, please point me in the
 right direction.




 import scipy.interpolate as interpolate

 primes  = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 ];
 nearest = interpolate.interp1d(primes, primes, 'nearest')

 inear = nearest(range(50))

 for i in range(len(inear)):
     print "%3d: %3d" % (i, inear[i])

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

More information about the Scipy-tickets mailing list