pandas.Series.from_arrow#
- classmethod Series.from_arrow(data)[source]#
Construct a Series from an array-like Arrow object.
This function accepts any Arrow-compatible array-like 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 object in Arrow format to pandas.Added in version 3.0.
- Parameters:
- datapyarrow.Array or Arrow-compatible object
Any array-like object implementing the Arrow PyCapsule Protocol (i.e. has an
__arrow_c_array__or__arrow_c_stream__method).
- Returns:
- Series
See also
DataFrame.from_arrowConstruct a DataFrame from an Arrow object.
Examples
>>> import pyarrow as pa >>> arrow_array = pa.array([1, 2, 3]) >>> pd.Series.from_arrow(arrow_array) 0 1 1 2 2 3 dtype: int64