print(b)
c = np.interp(np.where(mymask)[0], np.where(~mymask)[0], b[np.where(~mymask
    )[0]])
b[np.where(mymask)[0]] = c
print(b)
How to replace masked values from a numpy array with the average of the values immediately next to the masked value