Transposing a 2D List in Python
Transposing a 2-dimensional list in Python is especially useful when reading data that’s formatted similar to this: X Y Z 1 2 9 2 5 6 3 6 5 ... Usually, you’ll parse the input line by line and end up with an array that looks something like this: >>> print(data) [[1, 2, 9], [2, 5, 6], [3, 6, 5], ...] This usually isn’t useful though, as we normally want the x, y, and z values grouped together....