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:

dictionary_encode

dictionary_encode(
    array: ArrowArrayExportable | ArrowStreamExportable,
) -> Array | ArrayReader

Dictionary-encode array.

Return a dictionary-encoded version of the input array. This function does nothing if the input is already a dictionary array.

Note: for stream input, each output array will not necessarily have the same dictionary.

Parameters:

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.