错误代码:
df=pd.read_table('D:/desktop/data_exe/excel_test.txt',sep=' ')
输出:
报错原因:
解码错误
解决方法:
修正后的结果:
# 发现sep也有问题顺便改了下
df=pd.read_table('D:/desktop/data_exe/excel_test.txt',sep='\t')
id | name | class | subject | grade | |
0 | 1 | 八神 | 1 | python | 100 |
1 | 2 | 草薙京 | 1 | python | 99 |