[Scipy-tickets] [SciPy] #773: interp1d kind='nearest' does not do nearest-neighbour interpolation

SciPy scipy-tickets@scipy....
Sat Nov 1 16:09:12 CDT 2008


#773: interp1d kind='nearest' does not do nearest-neighbour interpolation
-------------------------------+--------------------------------------------
 Reporter:  pv                 |       Owner:  somebody        
     Type:  defect             |      Status:  new             
 Priority:  normal             |   Milestone:  0.7.0           
Component:  scipy.interpolate  |     Version:                  
 Severity:  normal             |    Keywords:  interp1d nearest
-------------------------------+--------------------------------------------
 Consider
 {{{
 from scipy.interpolate import interp1d
 x = [1, 2, 3, 4]
 y = [1, 2, 3, 4]
 ip = interp1d(x, y, kind='nearest')
 ip(1.9)  # -> array([ 1.])
 ip(2)    # -> array([ 2.])
 ip(2.1)  # -> array([ 2.])
 }}}
 So, it's not really nearest-neighbour interpolation, but instead
 interpolation with a step function.

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


More information about the Scipy-tickets mailing list