pandas dropna()
时间: 2023-10-21 16:29:14 浏览: 81
pandas的dropna()函数是用于滤除缺失数据的一个常用函数。在pandas中,NaN被用作缺失数据的标记。dropna()函数可以应用于Series或DataFrame对象。对于Series对象,dropna()函数返回一个只包含非空数值和索引的Series对象。例如,data['update_level'].dropna()可以滤除data中'update_level'列中的缺失值。对于DataFrame对象,dropna()函数可以通过axis参数来控制删除全为缺失值的行或列,默认为axis=0,即删除全为缺失值的行。通过subset参数可以指定删除包含特定列中缺失值的行。例如,data.dropna(axis=0, subset=['level','update_level'])可以删除包含'level'和'update_level'列中缺失值的行。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Pandas之Dropna滤除缺失数据的实现方法](https://download.csdn.net/download/weixin_38697063/13997589)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [pandas dropna()函数](https://blog.csdn.net/KIKI_ZSH/article/details/122882503)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文