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 pyarrow to 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_arrow

Construct 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