ak.ravel
--------

.. py:module: ak.ravel

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

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


    :param array: Array-like data (anything :py:obj:`ak.to_layout` recognizes).
    :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 array with all level of nesting removed by erasing the
boundaries between consecutive lists.

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

Consider the following:

.. code-block:: python


    >>> array = ak.Array([[[1.1, 2.2, 3.3],
    ...                    [],
    ...                    [4.4, 5.5],
    ...                    [6.6]],
    ...                   [],
    ...                   [[7.7],
    ...                    [8.8, 9.9]
    ...                   ]])

Ravelling the array produces a flat array

.. code-block:: python


    >>> ak.ravel(array).show()
    [1.1,
     2.2,
     3.3,
     4.4,
     5.5,
     6.6,
     7.7,
     8.8,
     9.9]

Missing values are not eliminated by flattening. See :py:obj:`ak.flatten` with
``axis=None`` for an equivalent function that eliminates the option type.