Rearrange data in csv with Python

Viewed 267

I have a .csv file with the following format:

A   B   C   D   E   F
X1  X2  X3  X4  X5  X6
Y1  Y2  Y3  Y4  Y5  Y6
Z1  Z2  Z3  Z4  Z5  Z6

What I want:

A   X1
B   X2
C   X3
D   X4
E   X5
F   X6
A   Y1
B   Y2
C   Y3
D   Y4
E   Y5
F   Y6
A   Z1
B   Z2
C   Z3
D   Z4
E   Z5
F   Z6

I am unable to wrap my mind around the built-in transpose functions in order to achieve the final result. Any help would be appreciated.

1 Answers
Related