I want to zip two arrays that have the same lengths but contain different dimensions of matrices.
a1 = np.ones((2,2,3),dtype=np.uint8)
a2 = np.ones((2,2,3),dtype=np.uint8)*2
b1 = np.ones((2,2),dtype=np.uint8)
b2 = np.ones((2,2),dtype=np.uint8)*2
Now Two arrays are c1, c2.
c1 = [a1,a2]
c2 = [b1,b2]
when I try to zip them like this.
res = np.array(list(zip(c1,c2)))
I get an error like following.
Traceback (most recent call last): File "", line 1, in ValueError: could not broadcast input array from shape (2,2,3) into shape (2,2)
Why I am getting this error? How Can I fix it?
a2is3D arrayanda1,b1,a2are2D arrayso shape of arraya2is differentres =?res). If you try and explain in more detail what your expected output is and what you want to do with it, it will be easier to help you