Defined in awkward._v2.operations.convert.ak_to_layout on line 11.

ak._v2.ak_to_layout.to_layout(array, allow_record=True, allow_other=False, numpytype=(np.number, np.bool_, np.str_, np.bytes_, np.datetime64, np.timedelta64))
  • array – Data to convert into a low-level ak.layout.Content layout or maybe ak.layout.Record, its record equivalent, or other types.

  • allow_record (bool) – If True, allow ak.layout.Record as an output; otherwise, if the output would be a scalar record, raise an error.

  • allow_other (bool) – If True, allow non-Awkward outputs; otherwise, if the output would be another type, raise an error.

  • numpytype (tuple of NumPy types) – Dtypes to allow from NumPy arrays.

Converts array (many types supported, including all Awkward Arrays and Records) into a ak.layout.Content and maybe ak.layout.Record or other types.

This function is usually used to sanitize inputs for other functions; it would rarely be used in a data analysis because ak.layout.Content and ak.layout.Record are lower-level than ak.Array.