ak.to_list#
Defined in awkward.operations.ak_to_list on line 20.
- ak.to_list(array)#
- Parameters:
array – Array-like data (anything
ak.to_layoutrecognizes).
Converts array (many types supported, including all Awkward Arrays and
Records) into Python objects. If array is not recognized as an array, it
is passed through as-is.
Awkward Array types have the following Pythonic translations.
ak.types.NumpyType: converted into bool, int, float, datetimes, etc. (Same as NumPy’sndarray.tolist.)ak.types.OptionType: missing values are converted into None.ak.types.ListType: converted into list.ak.types.RegularType: also converted into list. Python (and JSON) forms lose information about the regularity of list lengths.ak.types.ListTypewith parameter"__array__"equal to"__bytestring__": converted into bytes.ak.types.ListTypewith parameter"__array__"equal to"__string__": converted into str.ak.types.RecordArraywithout field names: converted into tuple.ak.types.RecordArraywith field names: converted into dict.ak.types.UnionArray: Python data are naturally heterogeneous.
See also ak.from_iter and ak.Array.tolist.