ak.with_name#

Defined in awkward.operations.ak_with_name on line 16.

ak.with_name(array, name, *, highlevel=True, behavior=None, attrs=None)#
Parameters:
  • array – Array-like data (anything ak.to_layout recognizes).

  • name (str or None) – Name to give to the records or tuples; this assigns the "__record__" parameter. If None, any existing name is unset.

  • highlevel (bool) – If True, return an ak.Array; otherwise, return a low-level ak.contents.Content subclass.

  • behavior (None or dict) – Custom ak.behavior for the output array, if high-level.

  • attrs (None or dict) – Custom attributes for the output array, if high-level.

Returns an ak.Array or ak.Record (or low-level equivalent, if highlevel=False) with a new name. This function does not change the array in-place. If the new name is None, then an array without a name is returned.

The records or tuples may be nested within multiple levels of nested lists. If records are nested within records, only the outermost are affected.

Setting the "__record__" parameter makes it possible to add behaviors to the data; see ak.Array and ak.behavior for a more complete description.