So let's say that I have an array like so:
[
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
]
I am attempting to stack every 2 arrays together, so I end up with the following:
[
[[1, 2, 3], [1, 2, 3]],
[[1, 2, 3], [1, 2, 3]],
]
It is especially important for this to be as efficient as possible as this will be running on hardware that is not too powerful, so I would prefer to do this without looping through the array. Is there a way to implement this in numpy without using loops? Thank you in advance.