dask.bag.Bag.flatten

dask.bag.Bag.flatten

Bag.flatten()[source]

Concatenate nested lists into one long list.

>>> import dask.bag as db
>>> b = db.from_sequence([[1], [2, 3]])
>>> list(b)
[[1], [2, 3]]
>>> list(b.flatten())
[1, 2, 3]