)
df.columns
结果输出
(10000, 14)
Index(['RowNumber', 'CustomerId', 'Surname', 'CreditScore', 'Geography'...RowNumber', 'CustomerId', 'Surname', 'CreditScore'], axis=1, inplace=True)
print(df[:2])
print(df.shape)
结果输出...通过将 isna 与 sum 函数一起使用,我们可以看到每列中缺失值的数量。...8.删除缺失值
处理缺失值的另一个方法是删除它们。以下代码将删除具有任何缺失值的行。...以下代码将基于 Geography、Gender 组合对行进行分组,然后给出每个组的平均流失率。