I currently have a list (list_arr) containing 8 numpy arrays with the following sizes:
0. (6300, 6675, 3)
1. (5560, 6675, 3)
2. (5560, 6675, 3)
3. (5560, 6675, 3)
4. (6300, 6675, 3)
5. (5560, 6675, 3)
6. (5560, 6675, 3)
7. (5560, 6675, 3)
I want to stack the arrays in batches of 4 (e.g., 0-3 and 4-7) so that the output array has a size of (22980, 6675, 3). This can be done manually using the following code:
out1 = np.vstack((list_arr[0], list_arr[1], list_arr[2], list_arr[3]))
out2 = np.vstack((list_arr[4], list_arr[5], list_arr[6], list_arr[7]))
However, I am going to upscale this code to a longer list of length = 116, and the above method is not very efficient. Is there a way to do this in a for-loop?