count nan values in an array code example Example: how many nan in array python np.count_nonzero(~np.isnan(data))