Let\'s take:
l = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
The result I\'m looking for is
r = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
Maybe not the most elegant solution, but here's a solution using nested while loops:
def transpose(lst): newlist = [] i = 0 while i < len(lst): j = 0 colvec = [] while j < len(lst): colvec.append(lst[j][i]) j = j + 1 newlist.append(colvec) i = i + 1 return newlist