ak.ones_like
------------

.. py:module: ak.ones_like

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

.. py:function:: ak.ones_like(array, *, dtype=None, including_unknown=False, highlevel=True, behavior=None, attrs=None)


    :param array: Array-like data (anything :py:obj:`ak.to_layout` recognizes).
    :param dtype: Overrides the data type of the result.
    :type dtype: None or NumPy dtype
    :param including_unknown: If True, the ``unknown`` type is considered
                          a value type and is converted to a zero-length array of the
                          specified dtype; if False, ``unknown`` will remain ``unknown``.
    :type including_unknown: bool
    :param highlevel: If True, return an :py:obj:`ak.Array`;
                  otherwise, return a low-level :py:obj:`ak.contents.Content` subclass.
    :type highlevel: bool, default is True
    :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

This is the equivalent of NumPy's ``np.ones_like`` for Awkward Arrays.

See :py:obj:`ak.full_like` for details, and see also :py:obj:`ak.zeros_like`.

(There is no equivalent of NumPy's ``np.empty_like`` because Awkward Arrays
are immutable.)