Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 numpy 中有nan,NaN和NAN. 拥有这三个是什么意思,它们有什么不同还是可以互换使用?
nan
NaN
NAN
>>> numpy.nan is numpy.NaN is numpy.NAN True
这只是方便。它们完全一样。
不同的操作系统和编程语言可能有不同的 NaN 字符串表示:
nan NaN NaN% NAN NaNQ NaNS qNaN sNaN 1.#SNAN 1.#QNAN -1.#IND
我认为拥有这三个只是一种方便。他们是一样的。
>>> np.nan nan >>> np.NaN nan >>> np.NAN nan >>>