numpy nan code example Example 1: np where nan np.argwhere(np.isnan(x)) Example 2: numpy is not nan a = a[~np.isnan(a)]