Python – How do I convert a Pandas future list to a Dask Dataframe?

How do I convert a Pandas future list to a Dask Dataframe?… here is a solution to the problem.

How do I convert a Pandas future list to a Dask Dataframe?

I have a list of Dask futures that points to the Pandas data frame:

from dask.dataframe import Client
client = Client()

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

How do I convert them to a Dask data frame?

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

Solution

You may want dask.dataframe.from_ delayed

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

For additional options, see docstrings.

Related Problems and Solutions