ak.to_arrow — Awkward Array 2.8.2 documentation (original) (raw)

Defined in awkward.operations.ak_to_arrow on line 15.

ak.to_arrow(array, *, list_to32=False, string_to32=False, bytestring_to32=False, emptyarray_to=None, categorical_as_dictionary=False, extensionarray=True, count_nulls=True)#

Parameters:

Converts an Awkward Array into an Apache Arrow array.

This produces arrays of type pyarrow.Array. You might need to further manipulations (using the pyarrow library) to build a pyarrow.ChunkedArray, a pyarrow.RecordBatch, or a pyarrow.Table. For the latter, see ak.to_arrow_table.

This function always preserves the values of a dataset; i.e. the Python objects returned by ak.to_list are identical to the Python objects returned by Arrow’sto_pylist method. With extensionarray=True, this function also preserves the data type (high-level ak.types.Type, though not the low-level ak.forms.Form), even through Parquet, making Parquet a good way to save Awkward Arrays for later use. If any third-party tools don’t recognize Arrow’s extension arrays, set this option to False for plain Arrow arrays.

See also ak.from_arrow, ak.to_arrow_table, ak.to_parquet, ak.from_arrow_schema.