[Numpy-discussion] the difference of np.nan, np.NaN, np.NAN?
Matthew Brett
matthew.brett at gmail.com
Fri Oct 14 05:04:46 EDT 2011
Hi,
On Fri, Oct 14, 2011 at 4:33 AM, Chao YUE <chaoyuejoy at gmail.com> wrote:
> Dear all,
>
> is there any difference between np.nan, np.NaN and np.NAN? they really
> confuse me....
> they are all Not a Number?
>
> In [75]: np.nan==np.NaN
> Out[75]: False
>
> In [77]: np.NaN==np.NAN
> Out[77]: False
The nan value is not equal to itself:
In [70]: np.nan == np.nan
Out[70]: False
See:
http://en.wikipedia.org/wiki/NaN
But:
In [71]: np.isnan(np.nan)
Out[71]: True
In [72]: np.isnan(np.NAN)
Out[72]: True
In [73]: np.isnan(np.NaN)
Out[73]: True
Best,
Matthew
More information about the NumPy-Discussion
mailing list