Added a more elegant (but more cryptic) solution with reshape and swapaxes. Removed one of the existing alternative solutions because it was a duplicate of a previous alternative solution.
Added a more elegant (but more cryptic) solution with reshape and swapaxes. Removed one of the existing alternative solutions because it was a duplicate of a previous alternative solution.