I have a string column in my pandas dataframe. I am facing error when i try to export this column to an excel file. Am able to export the dataframe if i delete that column.
I tried to decode all the values in that string column.I got the following error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x81 in position 16: ordinal not in range(128)
I debugged a little and found a column value in that particular column.I am not able to decode this value ('Einen Use case fr Brems-').
I took that value and tried the following code , facing error again.
#!/usr/bin/python
# -*- coding: utf-8 -*-
text = 'Einen Use case fr Brems-'
print text.decode()
1) i have tried adding following lines as well.
import sys
reload(sys)
sys.setdefaultencoding('utf8')
2) I tried this in my system:
import sys
print sys.getdefaultencoding()
i got 'ascii' as output.