Answers for "numpy count nan"

4

how many nan in array python

np.count_nonzero(~np.isnan(data))
Posted by: Guest on February-22-2020
1

numpy find rows containing nan

# in each case returns array of bool
np.isnan(a).any(axis=1) # rows where any value is nan
np.isnan(a).all(axis=1) # rows where all values are nan
Posted by: Guest on June-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language