| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/api/../../cpp/../python/generated/pyarrow.compute.index.html | [Back] [Original] |
Section Navigation
Find the index of the first occurrence of a given value.
The value to search for.
int, optionalint, optionalMemoryPool, optionalIf not passed, will allocate memory from the default memory pool.
intthe index, or -1 if not found
Examples
>>> import pyarrow as pa
>>> import pyarrow.compute as pc
>>> arr = pa.array(["Lorem", "ipsum", "dolor", "sit", "Lorem", "ipsum"])
>>> pc.index(arr, "ipsum")
<pyarrow.Int64Scalar: 1>
>>> pc.index(arr, "ipsum", start=2)
<pyarrow.Int64Scalar: 5>
>>> pc.index(arr, "amet")
<pyarrow.Int64Scalar: -1>
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 |