質問編集履歴
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -46,7 +46,8 @@
|
|
46
46
|
|
47
47
|
|
48
48
|
for i in range(res.shape[1]-1):
|
49
|
-
|
49
|
+
res['label'] = ['{0} {1}'.format(v1, v2) if v2 != 'NaN' else v1 for v1, v2 in zip(res['label'], res.iloc[:, i+1])]
|
50
|
+
|
50
51
|
res[['label']]
|
51
52
|
|
52
53
|
# <result>
|
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -59,6 +59,7 @@
|
|
59
59
|
```Python
|
60
60
|
res2 = res[['label']]
|
61
61
|
res2.to_csv('sample.txt', sep=' ', index=False, header=False)
|
62
|
+
# 追記:ここでのsepの設定は不要
|
62
63
|
|
63
64
|
# <result>
|
64
65
|
# "0 0:0.01 1:0.1 2:0.2 4:0.4"
|