I want to be able to sort a given array into 4-dimensional columns. The ONLY size of this actual array is 2-dimensional [[...], [...]], but I want to be able to convert any given array into this 2d (4d columns) array.
So say I have a the input array, and b the output array:
a = [1, 2, 3, 4, 5, 6, 7, 8]
b = [
[1, 3, 5, 7], # notice the pattern
[2, 4, 6, 8]
]
Another case:
a = [1, 2, 3, 4, 5, 6]
b = [
[1, 3, 5, None],
[2, 4, 6, None]
]
Another case:
a = [1, 2, 3, 4, ..., 100]
b = [
[1, 26, 51, 76],
[2, 27, 52, 77],
...,
[25, 50, 75, 100]
]
I've looked around online for this sort of formatting, but could only find reshaping using Numpy.
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]?