Skip to content

arro3.compute

arro3.compute

cast

Cast input to the provided data type and return a new Array with type to_type, if possible.

If input is an Array, an Array will be returned. If input is a ChunkedArray or ArrayReader, an ArrayReader will be returned.

Parameters:

Returns:

list_flatten

Unnest this ListArray, LargeListArray or FixedSizeListArray.

Parameters:

Returns:

list_offsets

list_offsets(
    input: ArrowArrayExportable | ArrowStreamExportable, *, logical: bool = True
) -> Array | ArrayReader

Access the offsets of this ListArray or LargeListArray

Parameters:

  • input (ArrowArrayExportable | ArrowStreamExportable) –

    description

  • physical

    If False, return the physical (unsliced) offsets of the provided list array. If True, adjust the list offsets for the current array slicing. Defaults to True.

Returns:

struct_field

struct_field(
    values: ArrowArrayExportable, /, indices: int | Sequence[int]
) -> Array

Access a column within a StructArray by index

Parameters:

  • values (ArrowArrayExportable) –

    Argument to compute function.

  • indices (int | Sequence[int]) –

    List of indices for chained field lookup, for example [4, 1] will look up the second nested field in the fifth outer field.

Returns:

take

take(values: ArrowArrayExportable, indices: ArrowArrayExportable) -> Array

Take elements by index from Array, creating a new Array from those indexes.

┌─────────────────┐      ┌─────────┐                              ┌─────────────────┐
│        A        │      │    0    │                              │        A        │
├─────────────────┤      ├─────────┤                              ├─────────────────┤
│        D        │      │    2    │                              │        B        │
├─────────────────┤      ├─────────┤   take(values, indices)      ├─────────────────┤
│        B        │      │    3    │ ─────────────────────────▶   │        C        │
├─────────────────┤      ├─────────┤                              ├─────────────────┤
│        C        │      │    1    │                              │        D        │
├─────────────────┤      └─────────┘                              └─────────────────┘
│        E        │
└─────────────────┘
values array             indices array                            result

Parameters:

Returns:

  • Array

    The selected arrow data.