ak.with_name
------------

.. py:module: ak.with_name

Defined in `awkward.operations.ak_with_name <https://github.com/scikit-hep/awkward/blob/36da52cfa8846355c390beb6555eac1d31c27c26/src/awkward/operations/ak_with_name.py>`__ on `line 16 <https://github.com/scikit-hep/awkward/blob/36da52cfa8846355c390beb6555eac1d31c27c26/src/awkward/operations/ak_with_name.py#L16>`__.

.. py:function:: ak.with_name(array, name, *, highlevel=True, behavior=None, attrs=None)


    :param array: Array-like data (anything :py:obj:`ak.to_layout` recognizes).
    :param name: Name to give to the records or tuples; this assigns
             the ``"__record__"`` parameter. If None, any existing name is unset.
    :type name: str or None
    :param highlevel: If True, return an :py:obj:`ak.Array`; otherwise, return
                  a low-level :py:obj:`ak.contents.Content` subclass.
    :type highlevel: bool
    :param behavior: Custom :py:obj:`ak.behavior` for the output array, if
                 high-level.
    :type behavior: None or dict
    :param attrs: Custom attributes for the output array, if
              high-level.
    :type attrs: None or dict

Returns an :py:obj:`ak.Array` or :py:obj:`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 :py:obj:`ak.Array` and :py:obj:`ak.behavior` for a more complete
description.