1 函数原型
DataFrame.dropna(axis=0, how='any', thresh=None, subset=None, inplace=False)
Remove missing values.
See the User Guide for more on which values are considered missing,
and how to work with missing data.
Returns
DataFrame
DataFrame with NA entries dropped from it.
2 功能
dropna()
函数用于删除dataframe
数据中的确实数据,即删除Nan数据。
3 参数说明
axis
:删除数据的维度,默认为0how
:{“any”, “all”},any:删除含有Nan的行,all:删除全为nan的行thresh
:int,保留至少thresh个非Nan行subset
:list,在特定列缺失值处理inplace
:是否修改源文件
4 举例
- 代码如下: