我正在尝试使用我自己的输入数据对 pd 系列中剩余的默认猫进行分类:
ex_df = df[df['Cat_Self_Pred'] == 'Uncatted'][['Content','Amount','Cat_Self_Pred']] # shallow copy, so that the orig df is changed
for x in range(len(ex_df)): # how ever many this would be
print(ex_df[['Content','Amount']].loc[x])
ex_df['Cat_Self_Pred'].loc[x] = input()
因此,对于 df['Cat_Self_Pred'] 的“Un_catted”,我想使用一种理解来根据“内容”和“金额”一次输入每一个
即使我执行上述操作,我也会收到有关将值分配给数据框副本的警告