Loading...
The Grid Pivot
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- junior, mid
Problem
A data pipeline processes columnar reports that need to be pivoted for downstream consumption. Write a function that takes a 2D matrix and returns its transpose - rows and columns swapped. Return an empty list for empty input.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.