I have a 1 dimensional array A of floats that is mostly good but a few of the values are missing. Missing data is replace with nan(not a number). I have to replace the missing values in the array by linear interpolation from the nearby good values. So, for example:
F7(np.array([10.,20.,nan,40.,50.,nan,30.]))
should return
np.array([10.,20.,30.,40.,50.,40.,30.]).
What's the best of way of doing this using Python?
Any help would be much appreciated
Thanks