I was wondering if there is a more pythonic/efficient way of reshaping my 2d-array into a 3d-array ? Here is the following working code :

```
import numpy as np
#
# Declaring the dimensions
n_ddl = 2
N = 3
n_H = n_ddl*N
#
# Typical 2D array to reshape
x_tilde_2d = np.array([[111,112,121,122,131,132],[211,212,221,222,231,232],[311,312,321,322,331,332]])
x_tilde_2d = x_tilde_2d.T
#
# Initialization of the output 3D array
x_tilde_reshaped_3d = np.zeros((N,x_tilde_2d.shape[1],n_ddl))
for i in range(0,x_tilde_2d.shape[1],1):
    x_tilde_sol = x_tilde_2d[:,i]
    x_tilde_sol_reshape = x_tilde_sol.reshape((N,n_ddl))
    for j in range(0,n_ddl,1):
        x_tilde_reshaped_3d[:,i,j] = x_tilde_sol_reshape[:,j]

```

Here is the raw expected output :

```
array([[[111., 112.],
        [211., 212.],
        [311., 312.]],

       [[121., 122.],
        [221., 222.],
        [321., 322.]],

       [[131., 132.],
        [231., 232.],
        [331., 332.]]])

```

and same output, along axis = 2 :

```
x_tilde_reshaped_3d[:,:,0] = np.array([[111., 211., 311.],
                                       [121., 221., 321.],
                                       [131., 231., 331.]])

x_tilde_reshaped_3d[:,:,1] = np.array([[112., 212., 312.],
                                       [122., 222., 322.],
                                       [132., 232., 332.]])

```

Any suggestions would be greatly appreciated. Thanks.