简体   繁体   中英

How to transform Dask.DataFrame to pd.DataFrame?

如何将生成的 dask.DataFrame 转换为 pandas.DataFrame (假设我已经完成了繁重的工作,并且只想将 sklearn 应用于我的聚合结果)?

您可以调用 .compute() 方法将 dask.dataframe 转换为 pandas 数据帧:

df = df.compute()
pd_df = pd.DataFrame(dsk_df)

Here you go. It's faster than dsk_df.compute() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM