当前位置:网站首页>UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte

UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte

2022-07-27 19:57:00 Roaming vegetable chicken

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte

Error code :df=pd.read_csv("./ttt.txt",sep=",",encoding=“utf-8”)

The solution is to convert the document code to utf8, Here are two solutions !
Solution one ( Failure ): Insert picture description here
Solution two ( success ):
use Notepad++ open , Then turn to utf-8 code , This transformation is successful .
Reference resources :https://blog.csdn.net/datadev_sh/article/details/83541811
 Insert picture description here

原网站

版权声明
本文为[Roaming vegetable chicken]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207271710487104.html