一个DataFrame 其中有空值NaN,将其替换为0:
df.fillna(0)
如果将第一列替换为0:
df[1].fillna(0,inplace=True)
一个DataFrame 其中有空值NaN,将其替换为0:
df.fillna(0)
如果将第一列替换为0:
df[1].fillna(0,inplace=True)
转载于:https://www.cnblogs.com/laoduan/p/python.html