pitrou commented on code in PR #41904:
URL: https://github.com/apache/arrow/pull/41904#discussion_r1708884662


##########
python/pyarrow/tests/test_csv.py:
##########
@@ -54,18 +53,32 @@ def generate_col_names():
             yield first + second
 
 
+def split_rows(arr, num_cols, num_rows):
+    # Split a num_cols x num_rows array into rows
+    for i in range(0, num_rows*num_cols, num_cols):
+        yield list(itertools.islice(arr, i, i + num_cols))
+
+
+def split_columns(arr, num_cols, num_rows):
+    # Split a num_cols x num_rows array into columns
+    for i in range(0, num_cols):
+        yield list(itertools.islice(arr, i, num_cols * num_rows, num_cols))

Review Comment:
   Same suggestion here:
   ```suggestion
       for i in range(0, num_cols):
           yield arr[i::num_cols]
   ```



-- 
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]

Reply via email to