简体   繁体   中英

Pandas read_excel UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte

The following codes creates the error

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0: invalid continuation byte

with open(file_path) as excel_file:
    df = pd.read_excel(excel_file)

The following code solved the issue

with open(file_path,mode="rb") as excel_file:
    df = pd.read_excel(excel_file)

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