danepitkin commented on code in PR #40313:
URL: https://github.com/apache/arrow/pull/40313#discussion_r1521798063
##########
docs/source/python/data.rst:
##########
@@ -230,6 +230,26 @@ like lists:
nested_arr = pa.array([[], None, [1, 2], [None, 1]])
print(nested_arr.type)
+ListView arrays
+~~~~~~~~~~~
+
+``pyarrow.array`` can create an alternate list type called ListView:
+
+.. ipython:: python
+
+ nested_arr = pa.array([[], None, [1, 2], [None, 1]],
type=pa.list_view(pa.int64()))
+ print(nested_arr.type)
+
+ListView arrays can specify out-of-order offsets when constructed from arrays:
+
+.. ipython:: python
+
+ values = [1, 2, 3, 4, 5, 6]
+ offsets = [4, 2, 0]
+ sizes = [2, 2, 2]
+ arr = pa.ListViewArray.from_arrays(offsets, sizes, values)
+ print(arr)
Review Comment:
Great suggestion! I will update
--
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]