-
df=df[~(df['col'].isnull())] #删掉空行
-
df=dropna(axis=0) #删除有空值的行,使用参数axis=0
-
df=dropna(axis=1) #删除有空值的列,使用参数axis=1
pandas 删掉空行
最新推荐文章于 2024-11-10 10:55:18 发布
df=df[~(df['col'].isnull())] #删掉空行
df=dropna(axis=0) #删除有空值的行,使用参数axis=0
df=dropna(axis=1) #删除有空值的列,使用参数axis=1