多次调用compute()时发生Dask错误

2024-09-30 02:17:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用dask,我需要在继续工作流之前使用compute()执行转换。在第二次转换期间,对象似乎改变了类型,并引发了错误'DataFrame' object has no attribute 'compute'

我当前的代码如下所示:

newtypes = {"age":int, "is_superuser":bool}
df = df.astype(newtypes).compute()
# ....
# 
....
strtypes = {"age":str, "is_superuser":str)
df = df.astype(strtypes).compute() # Here is raised the exception. 

Tags: 对象类型dataframedfageobjectis错误

热门问题