python - 根据缺失值的“Amount.Requested”列删除数据框中的整行
问题描述
考虑我是否有一列Amount.Requested
并且它有一些缺失值,所以现在基于这些缺失值Amount.Requested
我想删除整行,因为如果该列Amount.Requested
有缺失值,那么为我保留该客户端的数据是没有意义的示例代码。
解决方案
如果您有空值,那么要单独删除带有空值的行,请尝试
df = df.loc[~df['Amount.Requested'].isna()]
or
df = df.loc[df['Amount.Requested'] > 0]
推荐阅读
- html - 媒体查询在移动纵向模式下不起作用
- java - 如何检查用户是否存在于 Linux (JSch)
- c++ - 我们如何处理小于 double 但大于 float 的固定精度?
- android - 访问类的有效方法是驻留在应用程序模块的清单模块中吗?
- html - safari:`all:unset;`添加大量css规则
- tensorflow - “WARNING:tensorflow:Passing a `GraphDef` to the SummaryWriter is deprecated”是什么意思?
- python - 尝试运行while循环直到元素可见然后单击该元素
- android - 如何在 TabLayout 中添加菜单选项?
- angular - Angular 7 - [ngModel] 不适用于 mat-select
- java - 有没有办法并行运行单个黄瓜场景大纲?