Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

turn 0 into nan python

>>> a = np.arange(3.0)
>>> a
array([ 0.,  1.,  2.])
>>> a[a==0]
array([ 0.])
>>> a[a==0] = np.nan
>>> a
array([ nan,   1.,   2.])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #turn #nan #python
ADD COMMENT
Topic
Name
4+2 =