I'm trying to combine 2 2D arrays with different size into a 3D array like this:
a1 = np.array([[0,0,0,0,0,0],[1,1,1,1,1,1]])
print(a1.shape) #(2,6)
a2 = np.array([[0,0,0,0],[1,1,1,1]])
print(a2.shape) #(2,4)
combined = np.stack((a1,a2)) #ValueError: all input arrays must have the same shape
I'm trying to get the following:
>>> [[[0,0,0,0,0,0],[1,1,1,1,1,1]],[[0,0,0,0],[1,1,1,1]]]
Could someone help me?
(d1, d2, ..., dn). How do you propose your scheme to be able to do that?-1orNaNinstead.