How to Solve jupyter notebook Read CSV files Error

import pandas as pd
df = pd.read_csv('Pokemon1.csv',index_col = 0)

An error is reported after executing the code: Unicode decodeerror: ‘UTF-8’ codec can’t decode byte 0x89 in position 1538: invalid start byte
an error is still reported when trying to manually specify the encoding format [encoding = “UTF-8″/encoding = “GBK”):

df = pd.read_csv('Pokemon1.csv',index_col = 0,encoding="gbk")

Solution:
1 Find the CSV file used -> Right mouse button -> Opening method -> Select Notepad
2 Open the file and select File -> “Save as”, you can see that the default code is ANSI. Select UTF-8 to save a copy again, and then open it with PD.Read_csv(). There will be no error:


Read More: