I keep getting:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 265-266: ordinal not in range(128)
when I try:
df.to_html("mypage.html")
here is a sample of how to reproduce the problem:
df = pd.DataFrame({"a": [u'Rue du Gu\xc3\xa9, 78120 Sonchamp'], "b": [u"some other thing"]})
df.to_html("mypage.html")
the list of elements in "a"
are of type "unicode"
.
when I want to export it to csv it works because you can do:
df.to_csv("myfile.csv", encoding="utf-8")