[python] How can I check for NaN values?