How can I check for NaN values? by Tarik Use math.isnan: >>> import math >>> x = float('nan') >>> math.isnan(x) True