ak.to_numpy
-----------

Defined in `awkward.operations.convert <https://github.com/scikit-hep/awkward-1.0/blob/80bbef0738a6b7928333d7c705ee1b359991de5b/src/awkward/operations/convert.py>`__ on `line 163 <https://github.com/scikit-hep/awkward-1.0/blob/80bbef0738a6b7928333d7c705ee1b359991de5b/src/awkward/operations/convert.py#L163>`__.

.. py:function:: ak.to_numpy(array, allow_missing=True)

Converts ``array`` (many types supported, including all Awkward Arrays and
Records) into a NumPy array, if possible.

If the data are numerical and regular (nested lists have equal lengths
in each dimension, as described by the #type), they can be losslessly
converted to a NumPy array and this function returns without an error.

Otherwise, the function raises an error. It does not create a NumPy
array with dtype ``"O"`` for ``np.object_`` (see the
`note on object_ type <https://docs.scipy.org/doc/numpy/reference/arrays.scalars.html#arrays-scalars-built-in>`__)
since silent conversions to dtype ``"O"`` arrays would not only be a
significant performance hit, but would also break functionality, since
nested lists in a NumPy ``"O"`` array are severed from the array and
cannot be sliced as dimensions.

If ``array`` is a scalar, it is converted into a NumPy scalar.

If ``allow_missing`` is True; NumPy
`masked arrays <https://docs.scipy.org/doc/numpy/reference/maskedarray.html>`__
are a possible result; otherwise, missing values (None) cause this
function to raise an error.

See also :py:obj:`ak.from_numpy` and :py:obj:`ak.to_cupy`.

