pandas.DataFrame.from_arrow#
- classmethod DataFrame.from_arrow(data)[source]#
Construct a DataFrame from a tabular Arrow object.
This function accepts any Arrow-compatible tabular object implementing the Arrow PyCapsule Protocol (i.e. having an
__arrow_c_array__or__arrow_c_stream__method).This function currently relies on
pyarrowto convert the tabular object in Arrow format to pandas.Added in version 3.0.
- Parameters:
- datapyarrow.Table or Arrow-compatible table
Any tabular object implementing the Arrow PyCapsule Protocol (i.e. has an
__arrow_c_array__or__arrow_c_stream__method).
- Returns:
- DataFrame
See also
Series.from_arrowConstruct a Series from an Arrow object.
Examples
>>> import pyarrow as pa >>> table = pa.table({"a": [1, 2, 3], "b": ["x", "y", "z"]}) >>> pd.DataFrame.from_arrow(table) a b 0 1 x 1 2 y 2 3 z