Python + check if a variable is NaN code example
Example 1: python test is nan
math.isnan(n)
Example 2: check if a value is nan pandas
import numpy as np
import pandas as pd
val = np.nan
print(pd.isnull(val))
# True
math.isnan(n)
import numpy as np
import pandas as pd
val = np.nan
print(pd.isnull(val))
# True