报错:UnicodeDecodeError:: ‘utf-8‘ codec can‘t decode byte 0xc8 in position 0: invalid contin
python读取数据时出现:UnicodeDecodeError:: 'utf-8' codec can't decode byte 0xc8 in position 0: invalid contin
解决方法一:
f = open("xxx.csv",'r',encoding='UTF-8')
解决方法二:
f = open("xxx.csv","rb")
with open('article.txt','rb') as f: # 打开新的文本
text_new = f.read() # 读取文本数据