How do I convert from a dask dataframe to a list of futures?

你说的曾经没有我的故事 提交于 2019-12-24 23:59:37

问题


I have a dask dataframe like the following:

import dask.dataframe as dd
df = dd.read_csv('s3://...')

How do I get a list of futures from this dataframe?


回答1:


You can use the the .to_delayed method to convert from a dask dataframe to a list of dask.delayed objects

L = df.to_delayed()

You can then convert these delayed objects into dask futures using the client.compute method.

from dask.distributed import Client
client = Client()

futures = client.compute(L)


来源:https://stackoverflow.com/questions/48796323/how-do-i-convert-from-a-dask-dataframe-to-a-list-of-futures

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!