Python - Converting 3D numpy array to 2D I have a 3D matrix like this:

array([[[ 0,  1],
      [ 2,  3]],

      [[ 4,  5],
      [ 6,  7]],

      [[ 8,  9],
      [10, 11]],

      [[12, 13],
      [14, 15]]])


and would like to stack them in a grid format, ending up with:

 array([[ 0,  1],
        [ 2,  3],
        [ 4,  5],
        [ 6,  7],
        [ 8,  9],
        [10, 11],
        [12, 13],
        [14, 15]])


Currently, I'm using numpy as a library.
I suggest you to visit this link
also for this case would work np.reshape((-1,2))