I'm having an issue with broadcasting. I want to be able to assign elements from 4 different arrays of shape x, y to 2x2 matrices without a for loop if possible.
a = np.arange(6).reshape(2,3)
b = np.arange(6,12).reshape(2,3)
c = np.arange(12,18).reshape(2,3)
d = np.arange(18,24).reshape(2,3)
x = np.array([[a, b], [c, d]])
obviously this doesn't work but I'd like x to come out an array of:
[ [
[[0,6], [12, 18]],
[[1, 7], [13, 19]],
[[2, 8], [14, 20]],
],
[
[[3, 9], [15, 21]],
[[4, 10], [16, 22]],
[[5, 11], [17, 23]]
]
]