因此,我一直在我的深度学习分类器上设置标签档案,我想将一个已经存在的2D档案的标签连接到我刚刚制作的标签中。
存在的是'y_trainvalid'(39209,43),代表43类的39209张图像。我要添加的新标签档案是“ new_file_label”(23、43)。在这些档案中,如果数字与类匹配,则将其设置为1,否则将其设置为0。 这是它们两者的示例:
print(y_trainvalid)
print(new_file_label)
0 1 2 3 4 5 6 ... 36 37 38 39 40 41 42
0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 1.0 0.0 0.0 0.0 0.0
5 0.0 0.0 0.0 0.0 0.0 1.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 1.0 0.0 0.0 0.0
8 0.0 1.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
9 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
10 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
11 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
12 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
13 0.0 0.0 1.0 0.0 0.0 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.0 0.0 0.0 0.0
19 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
20 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
21 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
[23 rows x 43 columns]
当我尝试使用此命令进行连接时:
y_trainvalid2 = pd.concat([y_trainvalid, new_file_label], ignore_index=True)
这样的事情出现了:
0 1 2 3 4 5 6 ... 41 42 5 6 7 8 9
39204 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... NaN NaN NaN NaN NaN NaN NaN
39205 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... NaN NaN NaN NaN NaN NaN NaN
39206 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... NaN NaN NaN NaN NaN NaN NaN
39207 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... NaN NaN NaN NaN NaN NaN NaN
39208 0.0 0.0 0.0 0.0 0.0 0.0 0.0 ... NaN NaN NaN NaN NaN NaN NaN
39209 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39210 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39211 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39212 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39213 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39214 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39215 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39216 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39217 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39218 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39219 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39220 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39221 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39222 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39223 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39224 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39225 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39226 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39227 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39228 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39229 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39230 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
39231 NaN NaN NaN NaN NaN NaN NaN ... 0.0 0.0 0.0 0.0 0.0 0.0 0.0
好像它使列数加倍以适合数据,而不是将新数据放在其正下方。我不确定为什么会这样,因为我很确定两个标签档案的列数都相同。
当我使用'y_trainvalid2.head()。to_dict()'命令进行打印时,会出现:
{0: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'0': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
1: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'1': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
10: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'10': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
11: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'11': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
12: {0: 1.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'12': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
13: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'13': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
14: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'14': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
15: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'15': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
16: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'16': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
17: {0: 0.0, 1: 1.0, 2: 0.0, 3: 0.0, 4: 0.0},
'17': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
18: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'18': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
19: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'19': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
2: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'2': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
20: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'20': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
21: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'21': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
22: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'22': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
23: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'23': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
24: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'24': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
25: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'25': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
26: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'26': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
27: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'27': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
28: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'28': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
29: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'29': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
3: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'3': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
30: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'30': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
31: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'31': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
32: {0: 0.0, 1: 0.0, 2: 0.0, 3: 1.0, 4: 0.0},
'32': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
33: {0: 0.0, 1: 0.0, 2: 1.0, 3: 0.0, 4: 0.0},
'33': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
34: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'34': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
35: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'35': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
36: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'36': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
37: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'37': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
38: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 1.0},
'38': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
39: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'39': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
4: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'4': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
40: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'40': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
41: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'41': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
42: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'42': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
5: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'5': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
6: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'6': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
7: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'7': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
8: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'8': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan},
9: {0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0},
'9': {0: nan, 1: nan, 2: nan, 3: nan, 4: nan}}
我该如何解决这个问题?
答案 0 :(得分:1)
y_trainvalid.columns = [str(x) for x in y_trainvalid.columns]
new_file_label.columns = [str(x) for x in new_file_label.columns]
y_trainvalid2 = pd.concat([y_trainvalid, new_file_label])