ak.zip_no_broadcast#
Defined in awkward.operations.ak_zip_no_broadcast on line 20.
- ak.zip_no_broadcast(arrays, *, parameters=None, with_name=None, highlevel=True, behavior=None, attrs=None)#
- Parameters:
arrays (mapping or sequence of arrays) – Each value in this mapping or sequence can be any array-like data that
ak.to_layoutrecognizes.parameters (None or dict) – Parameters for the new
ak.contents.RecordArraynode that is created by this operation.with_name (None or str) – Assigns a
"__record__"name to the newak.contents.RecordArraynode that is created by this operation (overridingparameters, if necessary).highlevel (bool) – If True, return an
ak.Array; otherwise, return a low-levelak.contents.Contentsubclass.behavior (None or dict) – Custom
ak.behaviorfor the output array, if high-level.attrs (None or dict) – Custom attributes for the output array, if high-level.
Combines
arraysinto a single structure as the fields of a collection of records or the slots of a collection of tuples.Caution: unlike
ak.zipthis function will _not_ broadcast the arrays together. During typetracing, it assumes that the given arrays have already the same layouts and lengths.This operation may be thought of as the opposite of projection in
ak.Array.__getitem__, which extracts fields one at a time, orak.unzip, which extracts them all in one call.Consider the following arrays,
oneandtwo.>>> one = ak.Array([[1.1, 2.2, 3.3], [], [4.4, 5.5], [6.6]]) >>> two = ak.Array([["a", "b", "c"], [], ["d", "e"], ["f"]])
Zipping them together using a dict creates a collection of records with the same nesting structure as
oneandtwo.>>> ak.zip_no_broadcast({"x": one, "y": two}).show() [[{x: 1.1, y: 'a'}, {x: 2.2, y: 'b'}, {x: 3.3, y: 'c'}], [], [{x: 4.4, y: 'd'}], []]
Doing so with a list creates tuples, whose fields are not named.
>>> ak.zip_no_broadcast([one, two]).show() [[(1.1, 'a'), (2.2, 'b'), (3.3, 'c')], [], [(4.4, 'd')], []]