Pandas – Writing an excel file containing unicode – IllegalCharacterError
The same problem happened to me. I solved it as follows: First, install python package xlsxwriter: pip install xlsxwriter Second, replace the default engine ‘openpyxl’ with ‘xlsxwriter’: df.to_excel(“test.xlsx”, engine=”xlsxwriter”)