You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Eduardo Ponce (Jira)" <ji...@apache.org> on 2021/09/05 04:47:00 UTC

[jira] [Commented] (ARROW-12669) [C++] Kernel to return Array of elements at index of list in ListArray

    [ https://issues.apache.org/jira/browse/ARROW-12669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17410100#comment-17410100 ] 

Eduardo Ponce commented on ARROW-12669:
---------------------------------------

IIUC, the expected behavior in Numpy is:
{code:python}
>>> listarray = np.array([[1,2],[3,4],[5,6]])
array([[1, 2],
       [3, 4],
       [5, 6]])
>>> array = listarray[:,0]  # Get index 0 from all arrays
array([1, 3, 5])
>>> array = listarray[:,1]  # Get index 1 from all arrays
array([2, 4, 6])
{code}

> [C++] Kernel to return Array of elements at index of list in ListArray
> ----------------------------------------------------------------------
>
>                 Key: ARROW-12669
>                 URL: https://issues.apache.org/jira/browse/ARROW-12669
>             Project: Apache Arrow
>          Issue Type: New Feature
>          Components: C++
>            Reporter: Ian Cook
>            Priority: Major
>
> It would be useful to have a compute function that takes a {{ListArray<list<type>>}} and an integer index {{n}} and returns an {{Array<type>}} containing the {{n}} th item from each list.
> This would be useful in combination with existing functions that return list-type output, for example the string splitting functions.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)