Hi, I got a random array and tried repeat it several times to form a larger 1-D array.
However, when iterating the larger array to write to a file, it's still separated every a few elements which looks like there's still sub-array inside it. Any hint I can write it out in totally flattened way? Thanks
segment = np.random.randint(start_id, start_id+end_id-1, size=5, dtype="uint32")
out = np.tile(segment, 10000).flatten()
with open(outfile_path, "w") as f:
writer = csv.writer(f)
for i in out:
print("Line: ", str(i))
t = str(i)
writer.writerow(t)
The weird looking result is like:
8,7,9,0,6,7
3,7,1,3,6
2,8,5,9,2,0
7,4,4,3,4,9
5,5,6,2,5,1
8,7,9,0,6,7
... ...
But I was expecting:
8
7
9
0
...