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

Joris Van den Bossche commented on ARROW-7362:
----------------------------------------------

There was some discussion about this in ARROW-7031: 
https://github.com/apache/arrow/pull/5759, where it was said to not slice the 
values. 

Personally, I think it would be nice to have easy python access to the sliced 
values as well, but I also find it somewhat confusing to have {{.flatten()}} 
and {{.values}} differ.

> [Python] ListArray.flatten() should take care of slicing offsets
> ----------------------------------------------------------------
>
>                 Key: ARROW-7362
>                 URL: https://issues.apache.org/jira/browse/ARROW-7362
>             Project: Apache Arrow
>          Issue Type: Bug
>            Reporter: Zhuo Peng
>            Assignee: Zhuo Peng
>            Priority: Minor
>
> Currently ListArray.flatten() simply returns the child array. If a ListArray 
> is a slice of another ListArray, they will share the same child array, 
> however the expected behavior (I think) of flatten() should be returning an 
> Array that's a concatenation of all the sub-lists in the ListArray, so the 
> slicing offset should be taken into account.
>  
> For example:
> a = pa.array([[1], [2], [3]])
> assert a.flatten().equals(pa.array([1,2,3]))
> # expected:
> a.slice(1).flatten().equals(pa.array([2, 3]))



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

Reply via email to