# 识别python中DataFrame中的nanfor i in pfsj.index: if type(pfsj.loc[i]['WZML']) == float: print('float value is ${}'.format(pfsj.loc[i]['WZML'])) elif type(pfsj.loc[i]['WZML']) == str: print('str value is ${}'.format(pfsj.loc[i]['WZML'])) 结果: # 根据结果可知在Dat