Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python test if value is np.nan

import numpy as np

mynan = np.nan
mynum = 18

print("NaN? : ", np.isnan(mynan)) # Use np.isnan() to test
print("NaN? : ", np.isnan(mynum))

# Results:
# Nan? : True
# NaN? : False
 
PREVIOUS NEXT
Tagged: #python #test
ADD COMMENT
Topic
Name
1+8 =