Python Test If Variable Is Nan