Assigning a variable NaN in python without numpy
Yes — use math.nan. >>> from math import nan >>> print(nan) nan >>> print(nan + 2) nan >>> nan == nan False >>> import math >>> math.isnan(nan) True Before Python 3.5, one could use float(“nan”) (case insensitive). Note that checking to see if two things that are NaN are equal to one another will always … Read more