I feel like there is some documentation I am missing, but I can't find anything on this specific example - everything is just about concatenating or stacking arrays.
I have array x and array y both of shape (2,3)
x = [[1,2,3],[4,5,6]]
y = [[7,8,9],[10,11,12]]
x = 1 2 3
4 5 6
y = 7 8 9
10 11 12
I want array z with shape (2,3,2) that looks like this
z = [[[1,7],[2,8],[3,9]],[[4,10],[5,11],[6,12]]]
z = [1,7] [2,8] [3,9]
[4 10] [5 11] [6 12]
basically joins the x and y element at each position.
stackanddstack. They expand the array dimensions andconcatenateon one axis.stackis new function in this family.