Example 1: numpy reshape
np.reshape(a, (2, 3))
array([[0, 1, 2],
[3, 4, 5]])
np.reshape(np.ravel(a), (2, 3))
array([[0, 1, 2],
[3, 4, 5]])
np.reshape(a, (2, 3), order='F')
array([[0, 4, 3],
[2, 1, 5]])
np.reshape(np.ravel(a, order='F'), (2, 3), order='F')
array([[0, 4, 3],
[2, 1, 5]])
Example 2: np array reshape order
>>> np.reshape(a, (2, 3))
array([[0, 1, 2],
[3, 4, 5]])
>>> np.reshape(np.ravel(a), (2, 3))
array([[0, 1, 2],
[3, 4, 5]])
>>> np.reshape(a, (2, 3), order='F')
array([[0, 4, 3],
[2, 1, 5]])
>>> np.reshape(np.ravel(a, order='F'), (2, 3), order='F')
array([[0, 4, 3],
[2, 1, 5]])