| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/../api/../api/../generated/pyarrow.compute.take.html | [Back] [Original] |
Section Navigation
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.
Array, ChunkedArray, RecordBatch, or TableArray, ChunkedArrayMust be of integer type
TrueWhether to boundscheck the indices. If False and there is an out of bounds index, will likely cause the process to crash.
MemoryPool, optionalIf not passed, will allocate memory from the default memory pool.
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
]
Copyright 2016-2026 Apache Software Foundation.
Apache Arrow, Arrow, Apache, the Apache logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Created using Sphinx 9.1.0.
Built with the PyData Sphinx Theme 0.20.0.
| Web Proxy Viewer | New URL | Original Page |