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


##########
python/pyarrow/tests/test_csv.py:
##########
@@ -54,18 +53,31 @@ 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))
+
+
 def make_random_csv(num_cols=2, num_rows=10, linesep='\r\n', write_names=True):
-    arr = np.random.RandomState(42).randint(0, 1000, size=(num_cols, num_rows))
+    arr = [random.randint(0, 1000) for _ in range(num_cols * num_rows)]

Review Comment:
   We want to make random generation deterministic just like above, so perhaps 
something like:
   ```suggestion
       rnd = random.Random(42)
       arr = [rnd.randint(0, 1000) for _ in range(num_cols * num_rows)]
   ```



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