ak.to_arrow_table

Defined in awkward.operations.convert on line 2533.

ak.to_arrow_table(array, explode_records=False, list_to32=False, string_to32=True, bytestring_to32=True)
Parameters
  • array – Data to convert to an Apache Arrow table.

  • explode_records (bool) – If True, lists of records are written as records of lists, so that nested fields become top-level fields (which can be zipped when read back).

  • list_to32 (bool) – If True, convert Awkward lists into 32-bit Arrow lists if they’re small enough, even if it means an extra conversion. Otherwise, signed 32-bit ak.layout.ListOffsetArray maps to Arrow ListType and all others map to Arrow LargeListType.

  • string_to32 (bool) – Same as the above for Arrow string and large_string.

  • bytestring_to32 (bool) – Same as the above for Arrow binary and large_binary.

Converts an Awkward Array into an Apache Arrow table (pyarrow.Table).

If the array does not contain records at top-level, the Arrow table will consist of one field whose name is "".

Arrow tables can maintain the distinction between “option-type but no elements are missing” and “not option-type” at all levels, including the top level. However, there is no distinction between ?union[X, Y, Z]] type and union[?X, ?Y, ?Z] type. Be aware of these type distinctions when passing data through Arrow or Parquet.

See also ak.to_arrow, ak.from_arrow, ak.to_parquet.