dask_awkward.from_awkward

dask_awkward.from_awkward

dask_awkward.from_awkward(source, npartitions, behavior=None, label=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.

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

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'>