I'm searching from a simple method to interpolate a matrix that about 10% from values are NaN. For instance:
matrix = np.array([[ np.nan, np.nan, 2. , 3. , 4. ],
[ np.nan, 6. , 7. , 8. , 9. ],
[ 10. , 11. , 12. , 13., 14. ],
[ 15. , 16. , 17. , 18., 19. ],
[ np.nan, np.nan, 22. , 23., np.nan]])
I found a solution that uses griddata from scipy.interpolate, but the solution take much time. (My matrix have about 50 columns and 200,000 rows and the rate of Nan values does not higher than 10%)