我是达斯克的新人。我创建了一个dask数据帧,使用drop命令删除了一些列。在此之后,我将执行其他操作。当我调用compute时,get error:“Future”对象没有属性“drop”。在
在drop命令之后立即调用compute()可以正常工作,但是当我在之后调用它几个语句时,就会出现这个错误。请提出问题。在
顺便说一下,我使用的是分布在本地机器上的dask,版本是1.2.1。在
import dask.dataframe as dd
from dask.distributed import Client
client = Client()
df = dd.read_csv("XYZ.csv", sep="\t",low_memory=False) #Its about 3 GB in size
df = df.persist() #Data is split ito 47 partitions
list_of_columns_to_delete = ['ABC', 'AXY', 'JDR']
df = df.drop(list_of_columns_to_delete, axis=1, errors=True)
df.EngineSpeed.mean().compute() #this works fine and computes the mean
df = df[(df.Time < "23:59:59") ]
df = df[df.EngineSpeed > 605]
df = df[df.ServiceBrakeCircuit1AirPressure.notnull()]
df = df[df.ServiceBrakeCircuit2AirPressure.notnull()]
df.GpsSpeed = df.GpsSpeed.where(df.GpsSpeed < 111,111)
df.GpsSpeed.mean().compute() #This gives 'Future' object has no attribute 'drop' error`
请提出错误的含义以及如何纠正。在
我试着用一个类似的数据集产生错误,结果一切正常
我建议生成一个MCVE
相关问题 更多 >
编程相关推荐