Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

numpy remove rows containing nan

a = a[~(np.isnan(a).any(axis=1))] # removes rows containing at least one nan
a = a[~(np.isnan(a).all(axis=1))] # removes rows containing all nan
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #numpy #remove #rows #nan
ADD COMMENT
Topic
Name
8+7 =