python - Pandas to_excel bad converting of special characters although print(df) shows them fine -




i've got standard script queries postgresql database, puts query pandas dataframe, , using:

writer = pd.excelwriter('somepath.xlsx', encoding='utf-8') df.to_excel(writer, 'sheet1') writer.save() 

i getting following:

openpyxl.utils.exceptions.illegalcharactererror

when out dataframe csv, can see characters wrong:

ksi。ッki should ksiĄŻki.

but console output od print(df) shows characters fine:

console output:

6  124842  5205298                         sŁawomir leŚniewski     

csv output:

6   124842  5205298 s」awomir leヲniewski  

i've exported text such characters many times before, using same script.

any ideas?





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -