Error UnicodeDecodeError

An error was reported when using pandas' read_csv function to read a csv file. The reason is that the encoding of the csv file is ascii, and the default encoding format of read_csv is uft-8. There are two solutions: 1. Change the encoding of the file to uft-8. You can open the file with Notepad, then select the encoding as utf-8 when saving as, save as a csv file, and then use the read_csv function to read; 2. The read_csv function specifies the encoding format, pd.read_csv('data.csv', encoding="ISO-8859-1")

Guess you like

Origin blog.csdn.net/u012724887/article/details/107045089