我正在使用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.
如注释中所述,您的第二个数据帧实际上是一个Pandas数据帧,而不是Dask数据帧,因此您不需要第二次调用
.compute()
相关问题 更多 >
编程相关推荐