I'am having some trouble when initializing a numpy array with numpy.NAN as below.
>>> import numpy
>>> a = numpy.zeros(2)
>>> a
array([ 0., 0.])
>>> a[:] = numpy.NAN
>>> a
array([ nan, nan])
>>> a[0] is numpy.NAN
False
Why is that? I have tried to initilize a single variable with NAN and get var is numpy.NAN as True. What happends when NAN is assign to an array?
And another question is when some of the elements in the arrary is NAN, how can I distinguish them from others? Thanks a lot!
numpy.isnan.