Skip to content

ChunkedArray

arro3.core.ChunkedArray

chunks

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

nbytes

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

null_count

null_count: int = <attribute 'null_count' of 'arro3.core._core.ChunkedArray' objects>

num_chunks

num_chunks: int = <attribute 'num_chunks' of 'arro3.core._core.ChunkedArray' objects>

type

type: DataType = <attribute 'type' of 'arro3.core._core.ChunkedArray' objects>

__arrow_c_stream__ method descriptor

__arrow_c_stream__(requested_schema: object | None = None) -> 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 (as of pyarrow v16), you can call pyarrow.chunked_array() to convert this array into a pyarrow array, without copying memory.

cast method descriptor

cast(target_type: ArrowSchemaExportable) -> ChunkedArray

Cast array values to another data type

Parameters:

chunk method descriptor

chunk(i: int) -> Array

Select a chunk by its index.

Parameters:

  • i (int) –

    chunk index.

Returns:

combine_chunks method descriptor

combine_chunks() -> Array

Flatten this ChunkedArray into a single non-chunked array.

equals method descriptor

equals(other: ArrowStreamExportable) -> bool

Return whether the contents of two chunked arrays are equal.

from_arrow builtin

Construct this from an existing Arrow object.

It can be called on anything that exports the Arrow stream interface (has an __arrow_c_stream__ method). All batches from the stream will be materialized in memory.

from_arrow_pycapsule builtin

from_arrow_pycapsule(capsule) -> ChunkedArray

Construct this object from a bare Arrow PyCapsule

length method descriptor

length() -> int

Return length of a ChunkedArray.

slice method descriptor

slice(offset: int = 0, length: int | None = None) -> ChunkedArray

Compute zero-copy slice of this ChunkedArray

Parameters:

  • offset (int, default: 0 ) –

    Offset from start of array to slice. Defaults to 0.

  • length (int | None, default: None ) –

    Length of slice (default is until end of batch starting from offset).

Returns:

to_numpy method descriptor

to_numpy() -> NDArray

Copy this array to a numpy NDArray