-1

How to calculate the transpose of this without using numpy:

t = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
namos
  • 49
  • 4

1 Answers1

2

Just do:

t = list(zip(*t))

Output:

[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
Shrmn
  • 368
  • 4
  • 12