dask.bag.Bag.flatten

dask.bag.Bag.flatten

Bag.flatten()[源代码]

将嵌套列表连接成一个长列表。

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