- ak.with_field(array, what, where=None, *, highlevel=True, behavior=None)#
array – Array-like data (anything
what – Array-like data (anything
ak.to_layoutrecognizes) to add as a new field.
where (None or str or non-empy sequence of str) – If None, the new field has no name (can be accessed as an integer slot number in a string); If str, the name of the new field. If a sequence, it is interpreted as a path where to add the field in a nested record.
ak.Record.__setitem__ for a variant that
changes the high-level object in-place. (These methods internally use
ak.with_field, so performance is not a factor in choosing one over the