zoukankan      html  css  js  c++  java
  • 'utf-8' codec can't decode byte 0xd0 in position 0问题

    今天利用pd.read_csv(url)从网络上读取数据时出现了如下错误:

    'utf-8' codec can't decode byte 0xd0 in position 0

    问题原因:网络上的这个文件不是 UTF8 编码的,而系统默认采用 UTF8 解码,用UTF8编解码器无法解码该文件。

    但是如果把该文件的编码方式改为UTF8,文件又变成乱码格式,如下:

    解决办法:

    新建一个txt文件,把内容复制进去,点击另存为,在编码的地方选择UTF-8,再用pd.read_csv(),完美解决

    备注:sublime text3界面默认是不显示文件编码方式的,如果要想在右下角显示文件编码方式,可以

    preference --> settings --> 加入如下代码:

    "show_encoding": true,
    "show_line_endings": true,
  • 相关阅读:
    20200304(10)
    20200303Tuesday(9)
    词根词缀explicit(8)
    词根词缀(7)
    20200303(6)
    什么是ring0-ring3
    20200301a
    mark字体大全
    评估评价 提高专项(5)
    图的广度优先遍历算法
  • 原文地址:https://www.cnblogs.com/shuaishuaidefeizhu/p/9853764.html
Copyright © 2011-2022 走看看