FunctionRacerProblemsRace

Swap Rows and Columns

BeginnerNumPyPython

Return the transpose of the 2-D array grid: a table where the rows of grid become the columns. If grid has 2 rows and 3 columns, the answer has 3 rows and 2 columns, and result[j][i] == grid[i][j].

Example 1

grid [[1,2,3],[4,5,6]]
returns [[1,4],[2,5],[3,6]]

The answer is [[1, 4], [2, 5], [3, 6]].

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More NumPy problems