错误代码:
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 |
博客围绕Python错误展开,指出错误代码存在解码错误,介绍了报错原因是解码问题,并给出了解决方法,最后展示了修正后的结果。
650

被折叠的 条评论
为什么被折叠?



