读取dat文件本想像这样
df_train=pd.read_table(r'C:\Users\admin\Desktop\game_test\game\apptype_train.dat',
names=['s_no','deal_code','text'],sep='\t',encoding='utf-8')
不是报错就是文件读取数据量可能少了
像这样读取不会有问题的
f=open(r'C:\Users\admin\Desktop\game_test\game\apptype_train.dat',encoding='utf-8')
sentimentlist = []
for line in f:
s = line.strip().split('\t')
sentimentlist.append(s)
f.close()
df_train=pd.DataFrame(sentimentlist,columns=['s_no','deal_code','text'])