Joseph Hastings - 1 month ago 18

Python Question

`numpy.interp`

Unfortunately, it's not easy to tweak the source for

`numpy.interp`

`scipy.interpolate.interp1d`

`kind='zero'`

`kind='zero'`

`spleval`

`kind='linear'`

`slope=0`

`numpy.searchsorted`

`numpy.interp`

`scipy.interpolate.interp1d`

Answer

The `scipy.interpolate.interp1d`

can do all kinds of interpolation: ‘linear’,’nearest’, ‘zero’, ‘slinear’, ‘quadratic, ‘cubic’.

Please check the document: http://docs.scipy.org/doc/scipy-0.10.1/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d

Source (Stackoverflow)

Comments