Closed ZXXSG closed 7 months ago
报错代码片段: train_l_final = [] label_l_final = [] for k in train_x.keys(): train_l_final.append(train_x[k]) label_l_final.append(train.loc[k]['label']) df_train = pd.DataFrame({'emb': train_l_final, 'label': label_l_final, }) df_train.head()
AttributeError Traceback (most recent call last) Cell In[53], line 5 3 for k in train_x.keys(): 4 train_l_final.append(train_x[k]) ----> 5 label_l_final.append(train.loc[k]['label']) 7 df_train = pd.DataFrame({'emb': train_l_final, 'label': label_l_final, }) 8 df_train.head()
AttributeError: 'function' object has no attribute 'loc'
报错代码片段: train_l_final = [] label_l_final = [] for k in train_x.keys(): train_l_final.append(train_x[k]) label_l_final.append(train.loc[k]['label']) df_train = pd.DataFrame({'emb': train_l_final, 'label': label_l_final, }) df_train.head()
报错信息:
AttributeError Traceback (most recent call last) Cell In[53], line 5 3 for k in train_x.keys(): 4 train_l_final.append(train_x[k]) ----> 5 label_l_final.append(train.loc[k]['label']) 7 df_train = pd.DataFrame({'emb': train_l_final, 'label': label_l_final, }) 8 df_train.head()
AttributeError: 'function' object has no attribute 'loc'