[
https://issues.apache.org/jira/browse/ARROW-7031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated ARROW-7031:
----------------------------------
Labels: pull-request-available (was: )
> [Python] Expose the offsets of a ListArray in python
> ----------------------------------------------------
>
> Key: ARROW-7031
> URL: https://issues.apache.org/jira/browse/ARROW-7031
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Python
> Reporter: Joris Van den Bossche
> Priority: Major
> Labels: pull-request-available
>
> Assume the following ListArray:
> {code}
> In [1]: arr = pa.ListArray.from_arrays(offsets=[0, 3, 5], values=[1, 2, 3, 4,
> 5])
>
> In [2]: arr
>
>
> Out[2]:
> <pyarrow.lib.ListArray object at 0x7f11de71c708>
> [
> [
> 1,
> 2,
> 3
> ],
> [
> 4,
> 5
> ]
> ]
> {code}
> You can get the actual values as a flat array through {{.values}} /
> {{.flatten()}}, but there is currently no easy way to get back to the offsets
> (except from interpreting the buffers manually).
> We should probably add an {{offsets}} attribute (there is actually also a
> TODO comment for that).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)