chaokunyang opened a new issue, #35732:
URL: https://github.com/apache/arrow/issues/35732

   ### Describe the enhancement requested
   
   Numpy has fancy index support which can index an array by another array and 
get corresponding values:
   ```python
   arr1 = np.array([1,2,3])
   arr2 = np.array([1,2])
   arr3 = arr1[arr2]
   np.testing.assert_array_equal(arr3,  np.array([2, 3]))
   ```
   But arrow doesn't support it yet:
   ```python
   arrow_arr1 = pa.array(["a", "b", "c", "d"])
   arrow_arr1.slice(arr2)
   
   ---------------------------------------------------------------------------
   ValueError                                Traceback (most recent call last)
   Cell In[22], line 2
         1 arrow_arr1 = pa.array(["a", "b", "c", "d"])
   ----> 2 arrow_arr1.slice(arr2)
   
   File 
~/anaconda3/envs/py3.8/lib/python3.8/site-packages/pyarrow/array.pxi:1140, in 
pyarrow.lib.Array.slice()
   
   ValueError: The truth value of an array with more than one element is 
ambiguous. Use a.any() or a.all()
   ```
   
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to