Matrix Transpose

Transpose a 2D matrix (swap rows and columns).

Code

General
[list(row) for row in zip(*matrix)]

Parameters

2D matrix

Server

More Python Snippets