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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With