Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/docs/source/src/python/user-guide/misc/arrow.py
7890 views
1
# --8<-- [start:to_arrow]
2
import polars as pl
3
4
df = pl.DataFrame({"foo": [1, 2, 3], "bar": ["ham", "spam", "jam"]})
5
6
arrow_table = df.to_arrow()
7
print(arrow_table)
8
# --8<-- [end:to_arrow]
9
10
# --8<-- [start:to_arrow_zero]
11
arrow_table_zero_copy = df.to_arrow(compat_level=pl.CompatLevel.newest())
12
print(arrow_table_zero_copy)
13
# --8<-- [end:to_arrow_zero]
14
15