I have a 2D numpy array. Some of the values in this array are NaN. I want to perform certain operations using this array. For example consider the array:
NaN
You can use lambda function, an example for 1D array:
import numpy as np a = [np.nan, 2, 3] map(lambda v:0 if np.isnan(v) == True else v, a)
This will give you the result:
[0, 2, 3]