Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

interpolation with python numpy


I have an array of samples y, and corresponding x values. Some y-values may be missing and I'd like to use linear interpolation to compute them. What is the best way of doing it with python (I'm using numpy arrays). If you could provide me a sample code that would be great.

thanks

like image 795
Bob Avatar asked Mar 27 '11 00:03

Bob


1 Answers

See the interpolation method in the numpy documentation that has examples:

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

There are also a more extensive set of methods available through scipy:

http://docs.scipy.org/doc/scipy/reference/interpolate.html

like image 101
JoshAdel Avatar answered Oct 08 '22 04:10

JoshAdel