回答編集履歴
2
修正
test
CHANGED
@@ -12,7 +12,11 @@
|
|
12
12
|
|
13
13
|
newdata = pd.pivot_table(d0, index=['ExNo','M1','M2','M3']).reset_index()
|
14
14
|
|
15
|
+
# 列の順番を元に戻す
|
15
16
|
|
17
|
+
col = d0.columns.values
|
18
|
+
|
19
|
+
newdata = newdata.loc[:, col]
|
16
20
|
|
17
21
|
print(newdata)
|
18
22
|
|
1
修正
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
d0 = pd.read_csv('test.csv')
|
12
12
|
|
13
|
-
newdata = pd.pivot_table(d0, index=['ExNo','M1','M
|
13
|
+
newdata = pd.pivot_table(d0, index=['ExNo','M1','M2','M3']).reset_index()
|
14
14
|
|
15
15
|
|
16
16
|
|