Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

replace nan numpy array

from numpy import *

a = array([[1, 2, 3], [0, 3, NaN]])
where_are_NaNs = isnan(a)
a[where_are_NaNs] = 0
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #replace #nan #numpy #array
ADD COMMENT
Topic
Name
1+7 =