A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrow.apache.org/docs/python/generated/pyarrow.compute.take.html below:

pyarrow.compute.take — Apache Arrow v21.0.0

pyarrow.compute.take#
pyarrow.compute.take(data, indices, *, boundscheck=True, memory_pool=None)[source]#

Select values (or records) from array- or table-like data given integer selection indices.

The result will be of the same type(s) as the input, with elements taken from the input array (or record batch / table fields) at the given indices. If an index is null then the corresponding value in the output will be null.

Parameters:
dataArray, ChunkedArray, RecordBatch, or Table
indicesArray, ChunkedArray

Must be of integer type

boundscheckbool, default True

Whether to boundscheck the indices. If False and there is an out of bounds index, will likely cause the process to crash.

memory_poolMemoryPool, optional

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

Returns:
resultdepends on inputs

Selected values for the given indices

Examples

>>> import pyarrow as pa
>>> arr = pa.array(["a", "b", "c", None, "e", "f"])
>>> indices = pa.array([0, None, 4, 3])
>>> arr.take(indices)
<pyarrow.lib.StringArray object at ...>
[
  "a",
  null,
  "e",
  null
]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4