How to transpose a matrix without using numpy or zip (or other imports)
[[row[i] for row in data] for i in range(len(data[0]))]
How do you transpose a matrix without using numpy or zip or other imports?
I thought this was the answer but it does not work if the matrix has only 1 row...
[[row[i] for row in data] for i in range(len(data[1]))]