Problem:
I have a ndarray (2000,7) and I want to count the numbers of Nan’s per column and save it in an ndarray
Tried:
number_nan_in_arr = np.count_nonzero(np.isnan(arr))
But this count the total number of nan’s over all columns
Solution: ?
>Solution :
Simply sum the True values:
number_nan_in_arr = np.isnan(arr).sum(0)