What is identical to itself exists, otherwise not.
Pythonic Zen:
world = [0, 1, 2, 3, float("nan")]
[x for x in world if x == x]
Result:
[0, 1, 2, 3]
Explanation
According to IEEE754 (or PEP754),
NaN != X
.
Thus Nan != Nan
.
See also
Recommended Posts