How To Check If A Variable Has Nan Value In Python