Somewhat new to Dask but since most of the operations are lazy, how can I make a basic case like this work at scale?
import dask.dataframe as dd
import dask.bag as db
dataset = [
dict(a = 1, b = 2, c = 3),
dict(a = 3, b = 4, d = 5, e = 5),
dict(a = 2, x = 1, y = 2, z = 3, q = 5)
# etc...
]
dag_data = db.from_sequence(dataset)
dag_data.to_dataframe()
In a Pandas-only world, I could map pd.Series but the problem is these operations aren't calculated until after they are computed. The above code produces a DataFrame with only features from the first record ("a", "b", "c").
Exepcted result:
| a | b | c | d | e | q | x | y | z |
---------------------------------------
| 1 | 2 | 3 | - | - | - | - | - | - |
| 3 | 4 | - | 5 | 5 | - | - | - | - |
| 2 | - | - | - | - | 5 | 1 | 2 | 3 |