python-3.x - Drop rows in dask dataFrame on condition
问题描述
I'm trying to drop some rows in my dask dataframe with :
df.drop(df[(df.A <= 3) | (df.A > 1000)].index)
But this one doesn't work and return NotImplementedError: Drop currently only works for axis=1
I really need help
解决方案
You can remove rows from a Pandas/Dask dataframe as follows:
df = df[condition]
In your case you might do something like the following:
df = df[(df.A > 3) & (df.A <= 1000)]
推荐阅读
- php - 是否有一种编程方式来区分 bash 脚本是由用户执行还是通过 PHP 中的 shell_exec 执行?
- python - 在 mypy 中为什么 boolean 会传递浮点类型注释
- java - 如何在 java 中使用终端转义码?
- python - 在 python subprocess.popen 中通过标准输入发送输入
- ui5-tooling - 新项目的ui5初始化失败
- androidviewclient - ValueError:收到的不包含有效的 XML:已终止
- python - 为什么这里的多重赋值会产生意想不到的结果?
- python - Rabbitmq/Pika - 在 python 中获取给定队列的消费者列表
- php - 仅获取文件夹中的文件
- react-native - 平移和缩放 SVG 图像,但放大图像时不清晰