Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
Assume the following ListArray:
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 ] ]
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).