Replacing blank values (white space) with NaN in pandas
df0 = df0.applymap(lambda x: np.NaN if str(x).isspace() else x)
print("各列缺失行数为")
print(df0.isnull().sum())
print("各列未缺失行数为")
print(df0.notnull().sum())
参考链接
https://stackoverflow.com/questions/13445241/replacing-blank-values-white-space-with-nan-in-pandas