Loading...
Transpose a 2D NumPy array (swap rows and columns).
Transposing swaps rows and columns of a matrix. For an array of shape (m, n), transpose gives shape (n, m).
Write a function transpose_array(arr) that:
Return a dictionary with exactly these three keys.
[[1, 2, 3], [4, 5, 6]]
{'original_shape': [2, 3], 'transposed_shape': [3, 2], 'array': [[1, 4], [2, 5], [3, 6]]}2×3 matrix becomes 3x2 after transpose