[SciPy-User] Find and interpolate zero value

Pauli Virtanen pav@iki...
Fri Mar 29 11:42:45 CDT 2013


29.03.2013 16:27, Florian Lindner kirjoitti:
> Hello,
> 
> I have an array like:
> 
> array([[-1. ,  2. ],
>        [-0.5,  4. ],
>        [ 0.5,  6. ]])
> 
> first row are coordinates, second row is data.
> 
> Is there a scipy/numpy way to find zero from the first row and interpolate a 
> data value from the second row?

These may be helpful:

>>> numpy.lookfor('interpolate')
>>> numpy.lookfor('interpolate 1D', module='scipy')

http://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html
http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html

To find zeros, interpolate y-vs-x instead of x-vs-y

-- 
Pauli Virtanen



More information about the SciPy-User mailing list