简体   繁体   中英

Error while importing a csv file

I tried importing a csv file using

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?

你试过了吗:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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