首页 > 解决方案 > 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

标签: python-3.xdataframedata-analysisdask

解决方案


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)]

推荐阅读