Skip to content

Array

arro3.core.Array

A Python-facing Arrow array.

This is a wrapper around an [ArrayRef] and a [FieldRef].

field

field: Field = <attribute 'field' of 'arro3.core._core.Array' objects>

nbytes

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

type

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

__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.

cast method descriptor

cast(target_type: ArrowSchemaExportable) -> Array

Cast array values to another data type

Parameters:

from_arrow builtin

Construct this object from an existing Arrow object.

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

Parameters:

Returns:

from_arrow_pycapsule builtin

from_arrow_pycapsule(schema_capsule, array_capsule) -> Array

Construct this object from bare Arrow PyCapsules

from_numpy builtin

from_numpy(array: ndarray) -> Array

Construct an Array from a numpy ndarray

slice method descriptor

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

Compute zero-copy slice of this array.

Parameters:

  • offset (int, default: 0 ) –

    Defaults to 0.

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

    Defaults to None.

Returns:

  • Array

    The sliced array

to_numpy method descriptor

to_numpy() -> NDArray

Copy this array to a numpy NDArray