I am really new to dask. I want to create a dask dataframe from a python list of tuples. In pandas, you can use DataFrame.from_records
to convert a list of tuples to a dataframe. What function can give me same functionality in dask.
My data looks a bit like this
[(21262, 'booking', 'NULL'), (21262, 'booking', 'NULL'), (21262, 'booking', 'NULL'), (21262, 'booking', ''), (21262, 'booking', 'NULL')]
I am using this code to perform the task right now. Is this correct way of doing this.
import pandas as pd
import dask
import dask.dataframe as dd
names = ['id', 'status', 'reg_entry']
dfs = dask.delayed(pd.DataFrame.from_records)(cursor.fetchall(), columns=names)
df = dd.from_delayed(dfs)