使用“==”对比 两dataframe 发现存在“NaN == NaN”时结果为false,因此需要先替换dataframe中的NaN” 原excel 文件读入后: 1. 使用dataframe.applymap()自定义处理方法 def replce_nan(df): df=df.applymap(lambda x: x if str(x) != 'nan' else None) return df <