pyarrow.compute.array_take

pyarrow.compute.array_take(array, indices, /, *, boundscheck=True, options=None, memory_pool=None)

Select values from an array based on indices from another array.

The output is populated with values from the input array at positions given by indices. Nulls in indices emit null in the output.

Parameters
arrayArray-like

Argument to compute function.

indicesArray-like

Argument to compute function.

boundscheckbool, default True

Whether to check indices are within bounds. If False and an index is out of boundes, behavior is undefined (the process may crash).

optionspyarrow.compute.TakeOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.