pandas 如何将 Dask.DataFrame 转换为 pd.DataFrame?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39008391/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to transform Dask.DataFrame to pd.DataFrame?
提问by Philipp_Kats
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)?
如何将生成的 dask.DataFrame 转换为 pandas.DataFrame (假设我已经完成了繁重的工作,只想将 sklearn 应用于我的聚合结果)?
回答by MRocklin
You can call the .compute() method to transform a dask.dataframe to a pandas dataframe:
您可以调用 .compute() 方法将 dask.dataframe 转换为 pandas 数据帧:
df = df.compute()