polars.Series.to_arrow#

Series.to_arrow(
*,
compat_level: CompatLevel | None = None,
) Array[source]#

Return the underlying Arrow array.

If the Series contains only a single chunk this operation is zero copy.

Parameters:
compat_level

Use a specific compatibility level when exporting Polars’ internal data structures.

Examples

>>> s = pl.Series("a", [1, 2, 3])
>>> s = s.to_arrow()
>>> s  
<pyarrow.lib.Int64Array object at ...>
[
  1,
  2,
  3
]