简体   繁体   中英

How to resolve UnicodeDecodeError with pd.read_csv?

In the bottom right corner it says utf-8 codec can't decode byte 0x92 in position 12: invalid start byte. What does this mean?

在此处输入图像描述

Traceback

在此处输入图像描述

Try to change the encoding value of read_csv like so:

df = pd.read_csv("my.csv", encoding="latin-1")

The encoding you use should be the same one used by the csv. Here is a list of Python supported encodings .

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