table#

2026-03-11

20 min read time

Applies to Linux

class pylibhipdf.table.Table(list columns)#

Bases: object

A list of columns of the same size.

Parameters#

columnslist

The columns in this table.

__init__(*args, **kwargs)#
columns(self) list#

The columns in this table.

static from_arrow(obj: ArrowLike, dtype: DataType | None = None) Table#

Create a Table from an Arrow-like object using the Arrow C data interface.

This method supports constructing a pylibcudf.Table from an object that implements one of the Arrow C data interface protocols, such as:

  • __arrow_c_device_array__: Returns a tuple of (ArrowSchema, ArrowDeviceArray) representing columnar device memory.

  • __arrow_c_stream__: Returns an ArrowArrayStream pointer representing a stream of host columnar batches.

  • __arrow_c_device_stream__: Not yet implemented.

  • __arrow_c_array__: Not yet implemented.

Parameters#

objArrow-like type

An object implementing one of the Arrow C data interface methods.

dtype: DataType

The pylibcudf data type.

Returns#

Table

A Table constructed from the Arrow-like input.

Raises#

NotImplementedError

If the input is a device or host stream not yet supported. If the dtype argument is not None.

ValueError

If the input does not implement a supported Arrow C interface.

num_columns(self) int#

The number of columns in this table.

num_rows(self) int#

The number of rows in this table.

shape(self) tuple#

The shape of this table

to_arrow(self, metadata: list[ColumnMetadata | str] | None = None) ArrowLike#

Create a pyarrow table from a pylibcudf table.

Parameters#

metadatalist[ColumnMetadata | str] | None

The metadata to attach to the columns of the table.

Returns#

pyarrow.Table