How do I convert a list of Pandas futures to a Dask Dataframe?

拈花ヽ惹草 提交于 2019-12-10 23:35:34

问题


I have a list of Dask futures that point to Pandas dataframes:

from dask.dataframe import Client
client = Client()

import pandas
futures = client.map(pd.read_csv, filenames)

How do I convert these to a Dask dataframe?

note, I know that dask.dataframe.read_csv exists, I'm just using pd.read_csv as an example


回答1:


You probably want dask.dataframe.from_delayed

import dask.dataframe as dd
df = dd.from_delayed(futures)

See the docstring for additional options.



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

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