Python dataframe illegal character error into 'ascii' codec decode error -


i attempting write pandas dataframe excel. initially, received

openpyxl.utils.exceptions.illegalcharactererror 

which resolved with:

def export_file(clients):      clients = clients.applymap(lambda x: x.encode('unicode_escape').              decode('utf-8') if isinstance(x, str) else x)      clients.to_excel('all_clients.xlsx')      return() 

which resulted in:

 unicodedecodeerror: 'ascii' codec can't decode byte 0xe2 in position 17: ordinal not in range(128) 

however, if resolve unicode error initial pyxl error.

i seem unable resolve 1 error without getting opposing error. suggestions?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -