Changed np.nan -> np.NaN