[SciPy-dev] nearest neighbour interpolation
Mon Nov 17 14:23:36 CST 2008
Mon, 17 Nov 2008 18:42:03 +0000, Robin wrote:
> I just got bitten by this bug:
> It is quite nasty I think (I lost a lot of time...) and could be fixed
> easily just by changing the documentation. (At least so people don't
> loose so much time).
> My wiki username for the documentation is robince, so if I am enabled
> for write access I could make this change.
> Is there any way to get nearest neighbour interpolation in scipy? This
> bug looks related:
> http://www.scipy.org/scipy/scipy/ticket/305 Perhaps this could be
I have a clean and bug-fixed implementation from #305 here:
Shall I commit?
Or does someone immediately know how to fix the 'zero' order spline -- it
appears to have also other problems:
>>> from scipy.interpolate import interp1d
>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> c = interp1d(x,x,kind=0)
array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 8.])
More information about the Scipy-dev