python 'utf-8' codec can't decode byte 0xb8 in position 0: invalid start byte

 

 

In the Import csv file, the error shown above occurs, through access to information, the solution is as follows:

method one:

pd.read_csv(file_path, encoding='unicode_escape')

Method Two:

pd.read_csc(file_path.encoding='gbk')

Guess you like

Origin www.cnblogs.com/zhichun/p/11518469.html