dask_awkward.from_awkward

Contents

dask_awkward.from_awkward#

dask_awkward.from_awkward(source, npartitions, behavior=None, label=None, attrs=None)[source]#

Create an Array collection from a concrete awkward.Array object.

Parameters:
  • source (ak.Array) – The concrete awkward array.

  • npartitions (int) – The total number of partitions for the collection.

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

  • label (str, optional) – Label for the task.

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

Returns:

Resulting awkward array collection.

Return type:

Array

Examples

>>> import dask_awkward as dak
>>> import awkward as ak
>>> a = ak.Array([[1, 2, 3], [4], [5, 6, 7, 8]])
>>> c = dak.from_awkward(a, npartitions=3)
>>> c.partitions[[0, 1]].compute()
<Array [[1, 2, 3], [4]] type='2 * var * int64'>