dask_awkward.from_lists

Contents

dask_awkward.from_lists#

dask_awkward.from_lists(source, behavior=None, attrs=None)[source]#

Create an Array collection from a list of lists.

Parameters:
  • source (list[list[Any]]) – List of lists, each outer list will become a partition in the collection.

  • behavior (dict, optional) – Custom ak.behavior for the output array.

  • attrs (mapping, optional) – Custom attributes for the output array.

Returns:

Resulting Array collection.

Return type:

Array

Examples

>>> import dask_awkward as dak
>>> a = [[1, 2, 3], [4]]
>>> b = [[5], [6, 7, 8]]
>>> c = dak.from_lists([a, b])
>>> c
dask.awkward<from-lists, npartitions=2>
>>> c.compute()
<Array [[1, 2, 3], [4], [5], [6, 7, 8]] type='4 * var * int64'>