ak.regularize_numpyarray

Defined in awkward.operations.convert on line 1950.

ak.regularize_numpyarray(array, allow_empty=True, highlevel=True, behavior=None)
Parameters
  • array – Data to convert into an Awkward Array.

  • allow_empty (bool) – If True, allow ak.layout.EmptyArray in the output; otherwise, convert empty arrays into ak.layout.NumpyArray.

  • highlevel (bool) – If True, return an ak.Array; otherwise, return a low-level ak.layout.Content subclass.

  • behavior (None or dict) – Custom ak.behavior for the output array, if high-level.

Converts any multidimensional ak.layout.NumpyArray.shape into nested ak.layout.RegularArray nodes. The output may have any Awkward data type: this only changes the representation of ak.layout.NumpyArray.

This function is usually used to sanitize inputs for other functions; it would rarely be used in a data analysis.