I'm trying to do what this person is doing numpy: extending arrays along a new axis? but I don't want to repeat the same array in the new dimension. I'm generating a new 2D array and want to append it along a 3rd dimension
I've tried using np.stack((a,b), axis=2) but the arrays need to be the same shape. So after it stacks the first two arrays, the shapes on the second iteration are (256, 256, 2) and (256, 256) and I get ValueError: all input arrays must have the same shape
a = something #a has shape (256, 256)
for i in np.arange(0,10):
#calculate b and it also has shape (256,256)
a = np.stack((a,b), axis=2)
print(a.shape) #should give (256, 256, 10)