ak.from_numpy ------------- .. py:module: ak.from_numpy Defined in `awkward.operations.ak_from_numpy `__ on `line 12 `__. .. py:function:: ak.from_numpy(array, *, regulararray=False, recordarray=True, highlevel=True, behavior=None, attrs=None) :param array: The NumPy array to convert into an Awkward Array. This array can be a np.ma.MaskedArray. :type array: np.ndarray :param regulararray: If True and the array is multidimensional, the dimensions are represented by nested :py:obj:`ak.contents.RegularArray` nodes; if False and the array is multidimensional, the dimensions are represented by a multivalued :py:obj:`ak.contents.NumpyArray.shape`. If the array is one-dimensional, this has no effect. :type regulararray: bool :param recordarray: If True and the array is a NumPy structured array (dtype.names is not None), the fields are represented by an :py:obj:`ak.contents.RecordArray`; if False and the array is a structured array, the structure is left in the :py:obj:`ak.contents.NumpyArray` ``format``, which some functions do not recognize. :type recordarray: 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 :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 Converts a NumPy array into an Awkward Array. The resulting layout can only involve the following :py:obj:`ak.contents.Content` types: * :py:obj:`ak.contents.NumpyArray` * :py:obj:`ak.contents.ByteMaskedArray` or :py:obj:`ak.contents.UnmaskedArray` if the ``array`` is an np.ma.MaskedArray. * :py:obj:`ak.contents.RegularArray` if ``regulararray=True``. * :py:obj:`ak.contents.RecordArray` if ``recordarray=True``. See also :py:obj:`ak.to_numpy` and :py:obj:`ak.from_cupy`.