回答編集履歴

1

追記

2018/07/31 12:53

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -73,3 +73,43 @@
73
73
  print(elem, file=f)
74
74
 
75
75
  ```
76
+
77
+
78
+
79
+ コメントを受けて
80
+
81
+ ---
82
+
83
+ ```plain
84
+
85
+ 1.1,1.2,1.3
86
+
87
+ 2.1,2.2,2.3
88
+
89
+ ```
90
+
91
+
92
+
93
+ ```Python
94
+
95
+ import csv
96
+
97
+
98
+
99
+ with open('src.csv') as fin:
100
+
101
+ data = []
102
+
103
+ for row in csv.reader(fin):
104
+
105
+ data.append(row)
106
+
107
+
108
+
109
+ data = zip(*data)
110
+
111
+ with open('dst.csv', 'w') as fout:
112
+
113
+ csv.writer(fout).writerows(data)
114
+
115
+ ```