I’m using Numpy and have a 7x12x12 matrix whose values I would like to populate in 12×12 chunks, 7 different times. Suppose I have these 12×12 matrices:
first_Matrix
second_Matrix
third_Matrix
... (etc)
seventh_Matrix = first_Matrix + second_Matrix + third_Matrix...
that I’d like to add to:
grand_Matrix
How can I do this? I assume there is a better way than loops that map the coordinates from one matrix to the next, and if there’s not, could someone please write out the code for mapping first_Matrix into the first 12×12 element of grand_Matrix?
and so on.
Anyway, as @Lattyware commented, it is a bad design to have extra names for so many such homogenous objects.
If you have a list of 12×12 matrices:
Noneadds a new dimension to each matrix and stacks them along this dimension.