Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to transform Dask.DataFrame to pd.DataFrame?

How can I transform my resulting dask.DataFrame into pandas.DataFrame (let's say I am done with heavy lifting, and just want to apply sklearn to my aggregate result)?

like image 676
Philipp_Kats Avatar asked Aug 18 '16 00:08

Philipp_Kats


People also ask

Is Dask compatible with pandas?

Pandas does most of the things pretty well but screws in quite a few. Dask does not support these two things as well. There are numerous other things for which you'll have to use pandas.

Which is better Dask or pandas?

Dask runs faster than pandas for this query, even when the most inefficient column type is used, because it parallelizes the computations. pandas only uses 1 CPU core to run the query. My computer has 4 cores and Dask uses all the cores to run the computation.


1 Answers

You can call the .compute() method to transform a dask.dataframe to a pandas dataframe:

df = df.compute() 
like image 162
MRocklin Avatar answered Sep 30 '22 19:09

MRocklin