回答編集履歴
1
修正
answer
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
```python
|
5
5
|
df_new = (df.set_index(df.groupby(level=0).cumcount(), append=True)
|
6
6
|
.unstack()
|
7
|
-
.
|
7
|
+
.sort_index(axis=1, level=1, sort_remaining=False))
|
8
8
|
df_new.columns = [c + str(n + 1) for c, n in df_new.columns]
|
9
9
|
```
|
10
10
|
|