I am reading an excel file that has several numerical and categorical data. The columns name_string contains characters in a foreign language. When I try to see the content of the name_string column, I get the results I want, but the foreign characters (that are displayed correctly in the excel spreadsheet) are displayed with the wrong encoding. Here is what I have:
import pandas as pd
df = pd.read_excel('MC_simulation.xlsx', 'DataSet', encoding='utf-8')
name_string = df.name_string.unique()
name_string.sort()
name_string
Producing the following:
array([u'4th of July', u'911', u'Abab', u'Abass', u'Abcar', u'Abced',
u'Ceded', u'Cedes', u'Cedfus', u'Ceding', u'Cedtim', u'Cedtol',
u'Cedxer', u'Chevrolet Corvette', u'Chuck Norris',
u'Cristina Fern\xe1ndez de Kirchner'], dtype=object)
In the last line, the correctly encoded name should be Cristina Fernández de Kirchner. Can anybody help me with this issue?