I am using Python 2.7 on Windows7. I just learned Python for 2 days and got some CSV modules unfamiliar, hope to obtain your help here.
My current output(CSV data) is like this:
Angle Dist Intensity Error
0 0 32896 8080
1 0 32896 8080
2 0 32896 8080
3 0 32896 8080
4 0 32896 8080
5 0 32896 8080
6 0 32896 8080
7 0 32896 8080
My question is, how to transpose/rearrange data from columns to one row in Python? To be more specific, I would like to get the following format:
Angle 1 2 3 4...7 Dist 0 0 0...0 Intensity # # # # ... Error # # # # ...
My current code is:
with open("C:\Logging\\" + date + "Result.csv", 'r') as f:
reader = csv.reader(f, delimiter=',')
for row in reader:
csv.writer(f, row)