-
-
Save kozo496/3d99170df2824ba9b273ceab4db8ec29 to your computer and use it in GitHub Desktop.
convert dask dataframe to pandas.dataframe (ref: https://coiled.io/blog/converting-a-dask-dataframe-to-a-pandas-dataframe/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://coiled.io/blog/converting-a-dask-dataframe-to-a-pandas-dataframe/ | |
import dask.dataframe as dd | |
import pandas as pd | |
df = pd.DataFrame( | |
{"nums": [1, 2, 3, 4, 5, 6], "letters": ["a", "b", "c", "d", "e", "f"]} | |
) | |
ddf = dd.from_pandas(df, npartitions=2) | |
# dask.dataframeをpandas.dataframeに変換 | |
pandas_df = ddf.compute() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment