Spec-Zone.ru › Polars

polars.DataFrame.to_arrow

DataFrame.to_arrow(
    *,
    compat_level: CompatLevel | None = None,
) → Table

Collect the underlying arrow arrays in an Arrow Table.

This operation is mostly zero copy.

Data types that do copy:
  • CategoricalType

Changed in version 1.1: The future parameter was renamed compat_level.

Parameters:
compat_level

Compatibility level to use when exporting Polars data structures. The default compatibility level is recommended for most users. Use pl.CompatLevel.oldest() for the most compatible level. pl.CompatLevel.newest() uses the highest supported compatibility level, but is considered unstable and may change without it being considered a breaking change.

Examples

>>> df = pl.DataFrame(
...     {"foo": [1, 2, 3, 4, 5, 6], "bar": ["a", "b", "c", "d", "e", "f"]}
... )
>>> df.to_arrow()
pyarrow.Table
foo: int64
bar: large_string
----
foo: [[1,2,3,4,5,6]]
bar: [["a","b","c","d","e","f"]]

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.to_arrow.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API