diff --git a/python/pyarrow/compute.py b/python/pyarrow/compute.py index 83612f66d21e2..426ecae31c039 100644 --- a/python/pyarrow/compute.py +++ b/python/pyarrow/compute.py @@ -423,6 +423,18 @@ def index(data, value, start=None, end=None, *, memory_pool=None): ------- index : int the 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") + + >>> pc.index(arr, "ipsum", start=2) + + >>> pc.index(arr, "amet") + """ if start is not None: if end is not None: