to_arrow
to_arrow
converts a Deephaven table to a PyArrow table.
Syntax
to_arrow(table: Table, cols: list[str] = None) -> pyarrow.lib.Table
Parameters
Parameter | Type | Description |
---|---|---|
table | Table | A Deephaven table. |
cols optional | list[str] | The columns to convert. Default is |
Returns
A PyArrow table.
Examples
The following example converts a Deephaven table to a PyArrow table:
from deephaven import arrow as dhpa
from deephaven import empty_table
import pyarrow as pa
source = empty_table(10).update(["X = i", "Y = sin(X)", "Z = cos(X)"])
pa_source = dhpa.to_arrow(table=source)
- source
The following example converts a Deephaven table to a PyArrow table, but only the X
and Z
columns:
from deephaven import arrow as dhpa
from deephaven import empty_table
import pyarrow as pa
source = empty_table(10).update(["X = i", "Y = sin(X)", "Z = cos(X)"])
pa_source = dhpa.to_arrow(table=source, cols=["X", "Z"])
- source