@ 解决pandas读文件报错 UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x8e in position 17: invalid start byte
pandas读文件UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e in position 17: invalid start byte

解决方案:

最开始加上:
#-- coding: utf-8 --
或者
#coding: utf-8
这样的话有时候行,有时候不行。
然后在读取的时候编码用‘gbk’
df_data = pd.read_csv(dataset_filepath, encoding=u’gbk’)
这样就顺利解决报错了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-06-07
  • 2022-12-23
  • 2021-08-29
  • 2021-10-28
  • 2021-03-31
猜你喜欢
  • 2021-11-19
  • 2021-06-15
  • 2021-06-11
  • 2021-09-28
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案