pyspark.sql.DataFrame.toArrow#
- DataFrame.toArrow()[source]#
Returns the contents of this
DataFrameas PyArrowpyarrow.Table.This is only available if PyArrow is installed and available.
New in version 4.0.0.
Notes
This method should only be used if the resulting PyArrow
pyarrow.Tableis expected to be small, as all the data is loaded into the driver’s memory.This API is a developer API.
Examples
>>> df.toArrow() pyarrow.Table age: int64 name: string ---- age: [[2,5]] name: [["Alice","Bob"]]