一、numpy判断
import numpy as np
nan = float('nan')
print(np.isnan(nan))
二、pandas判断
import pandas as pd
nan = float('nan')
print(pd.isna(nan))
三、和自身比较
def is_nan(nan):
return nan != nan
nan = float('nan')
print(is_nan(nan))
标签:判断,float,nan,np,三种,pd,print,numpy
From: https://blog.51cto.com/coderusher/5989513