What is the difference between nan, NaN and NAN

In numpy there are nan , nan and nan . What is the feeling of having all three, are they different or can any of them be used interchangeably?

+8
python numpy nan
source share
2 answers
 >>> numpy.nan is numpy.NaN is numpy.NAN True 

It is just convenient. They are exactly the same.

+10
source share

Different operating systems and programming languages ​​can have different string representations of NaN:

  nan NaN NaN% NAN NaNQ NaNS qNaN sNaN 1.#SNAN 1.#QNAN -1.#IND 

I think all three are just comfortable. They are the same.

 >>> np.nan nan >>> np.NaN nan >>> np.NAN nan >>> 
+1
source share

All Articles