df=df[~(df['col'].isnull())] #删掉空行
df=df.dropna(axis=0) #删除有空值的行,使用参数axis=0
df=df.dropna(axis=1) #删除有空值的列,使用参数axis=1
dataframe 删除空行及去重
最新推荐文章于 2023-07-19 13:43:09 发布
df=df[~(df['col'].isnull())] #删掉空行
df=df.dropna(axis=0) #删除有空值的行,使用参数axis=0
df=df.dropna(axis=1) #删除有空值的列,使用参数axis=1