numpy transpose last 2 axes code example Example: numpy transpose last 2 axes >>> x = np.ones((1, 2, 3)) >>> np.transpose(x, (1, 0, 2)).shape (2, 1, 3)