Skip to content

RecordBatch

arro3.core.RecordBatch

A Python-facing Arrow record batch.

This is a wrapper around a [RecordBatch].

column_names

column_names: list[str] = <attribute 'column_names' of 'arro3.core._core.RecordBatch' objects>

Names of the Table or RecordBatch columns.

columns

columns: list[Array] = <attribute 'columns' of 'arro3.core._core.RecordBatch' objects>

List of all columns in numerical order.

nbytes

nbytes: int = <attribute 'nbytes' of 'arro3.core._core.RecordBatch' objects>

num_columns

num_columns: int = <attribute 'num_columns' of 'arro3.core._core.RecordBatch' objects>

Number of columns in this RecordBatch.

num_rows

num_rows: int = <attribute 'num_rows' of 'arro3.core._core.RecordBatch' objects>

Number of rows in this RecordBatch.

schema

schema: Schema = <attribute 'schema' of 'arro3.core._core.RecordBatch' objects>

shape

shape: tuple[int, int] = <attribute 'shape' of 'arro3.core._core.RecordBatch' objects>

Dimensions of the table or record batch: (#rows, #columns).

__arrow_c_array__ method descriptor

__arrow_c_array__(
    requested_schema: object | None = None,
) -> tuple[object, object]

An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.

For example, you can call pyarrow.array() to convert this array into a pyarrow array, without copying memory.

append_column method descriptor

append_column(
    field: str | ArrowSchemaExportable, column: ArrowArrayExportable
) -> RecordBatch

Append column at end of columns.

Parameters:

Returns:

column method descriptor

column(i: int | str) -> ChunkedArray

Select single column from RecordBatch

equals method descriptor

equals(other: ArrowArrayExportable) -> bool

Check if contents of two record batches are equal.

Parameters:

Returns:

  • bool

    description

field method descriptor

field(i: int | str) -> Field

Select a schema field by its numeric index.

from_arrays builtin

from_arrays(
    arrays: Sequence[ArrowArrayExportable], *, schema: ArrowSchemaExportable
) -> RecordBatch

Construct a RecordBatch from multiple Arrays

from_arrow builtin

Construct this from an existing Arrow RecordBatch.

It can be called on anything that exports the Arrow data interface (__arrow_c_array__) and returns a StructArray..

Parameters:

Returns:

from_arrow_pycapsule builtin

from_arrow_pycapsule(schema_capsule, array_capsule) -> RecordBatch

Construct this object from a bare Arrow PyCapsule

from_pydict builtin

from_pydict(
    mapping: dict[str, ArrowArrayExportable],
    *,
    metadata: ArrowSchemaExportable | None = None
) -> RecordBatch

Construct a Table or RecordBatch from Arrow arrays or columns.

Parameters:

Returns:

from_struct_array builtin

from_struct_array(struct_array: ArrowArrayExportable) -> RecordBatch

Construct a RecordBatch from a StructArray.

Each field in the StructArray will become a column in the resulting RecordBatch.

remove_column method descriptor

remove_column(i: int) -> RecordBatch

Create new RecordBatch with the indicated column removed.

Parameters:

  • i (int) –

    Index of column to remove.

Returns: