I am trying to make a "results" dataframe with in each cell calculated values and their uncertainties, separated with the ± symbol. I then save the dataframe to a csv. I've made the example below to illustrate the problem: when I open the csv with textedit (or print it to screen) it all works. However, when I open (or import) the csv in excel suddenly the ± symbol is proceeded with another symbol: Â.
I've tried to force the variable to a string using "str()" and played around with the "encoding='utf-8' " but I can't seem to figure out what's going wrong here.. I'm using Python2.7 and Komodo on a macbook air.
import os
import pandas as pd
PmSign = (u'\u00B1').encode("utf-8")
columns = ['A']
data = [1,2,3,4,'5 {} 3' .format(PmSign),6]
df = pd.DataFrame(data, columns=columns)
df.to_csv(os.path.join('/Users/python/','UnicodeDFTEST.csv'), encoding='utf-8')