简体   繁体   English

导入CSV文件时出错

[英]Error while importing a csv file

I tried importing a csv file using 我尝试使用导入csv文件

import pandas as pd
df=pd.read_csv("samle.csv")

But there is an error while importing the file : 但是导入文件时出错:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 28: invalid start byte

As i looked in the csv file, it had some characters like this: How do i rectify this error? 当我在csv文件中查看时,它具有一些这样的字符: 我该如何纠正此错误?

你试过了吗:

df = pd.read_csv("samle.csv", encoding='ISO-8859-1')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM