I just saw this question here, and my answer and another person's are both correct. If I were the OP, I wouldn't know which to accept. How should we accept answers in this situation?
1 Answer
I would accept your answer if I was the OP of the question.
It is simpler since it only relies on one method call, whereas the other one has three calls.
It also has the most upvotes.
But acceptance is up to the OP. He could accept either one or none at all. On Stack Overflow it is considered bad practice to try to influence OP to accept any answer.
np.hstack
fromnp.dstack
s is not trivially applicable (and 2x slower) for the actual use case (grid of 16x16 chunks of 3D arrays) mentioned.