Removing nan values from a Python List,cleanlist = [(0.0 if math.isnan(x) else x) for x in oldlist]