[SciPy-User] Find and interpolate zero value

Florian Lindner mailinglists@xgm...
Fri Mar 29 09:27:56 CDT 2013


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?

Here I the result would be 5 ( 4 + (6-4)/( 0.5 - (-0.5)) * 0.5 )

How would this best be done with scipy/numpy?

Thanks,

Florian


More information about the SciPy-User mailing list