【发布时间】:2023-02-01 23:43:17
【问题描述】:
我正在使用数据框 dropna 函数删除所有空值,但它不起作用
df.dropna(how = 'all', inplace = True)
df1 = df.copy()
print(df1.isnull().sum())
输出:
Ind_ID 0
Test_date 0
Cough_symptoms 252
Fever 252
Sore_throat 1
Shortness_of_breath 1
Headache 1
Corona 3892
Age_60_above 127320
Sex 19563
Known_contact 242741
dtype: int64
【问题讨论】:
-
how="all" 中的 "all" 并不意味着 "drop all missings";请参阅here 了解其含义。