How about:
>>> import numpy as np
>>> a=np.arange(1,7).reshape((2,3))
>>> a
array([[1, 2, 3],
[4, 5, 6]])
>>> a.flatten()
array([1, 2, 3, 4, 5, 6])
and
>>> import numpy as np
>>> b=np.arange(1,13).reshape((2,2,3))
>>> b
array([[[ 1, 2, 3],
[ 4, 5, 6]],
[[ 7, 8, 9],
[10, 11, 12]]])
>>> b.reshape((2,6))
array([[ 1, 2, 3, 4, 5, 6],
[ 7, 8, 9, 10, 11, 12]])