np import data 0 if nan code example Example 1: numpy fill na with 0 import numpy as np A[np.isnan(A)] = 0 Example 2: np where nan np.argwhere(np.isnan(x))