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
Post a Comment