Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
UnicodeEncodeError with to_sql and unicode column names #11431
Comments
jorisvandenbossche
added Bug Unicode IO SQL
labels
Oct 26, 2015
jorisvandenbossche
added this to the
0.17.1
milestone
Oct 26, 2015
|
I suppose we should just use |
jorisvandenbossche
referenced
this issue
Oct 26, 2015
Merged
BUG: fix UnicodeEncodeError with to_sql and unicode column names (GH11431) #11432
jreback
modified the milestone: Next Major Release, 0.17.1
Nov 13, 2015
jorisvandenbossche
modified the milestone: 0.17.1, Next Major Release
Nov 13, 2015
jorisvandenbossche
closed this
in #11432
Nov 16, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jorisvandenbossche commentedOct 26, 2015
From SO: http://stackoverflow.com/questions/33337798/unicodeencodeerror-when-using-pandas-method-to-sql-on-a-dataframe-with-unicode-c
To reproduce:
which gives
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128), because of this line: https://github.com/pydata/pandas/blob/master/pandas/io/sql.py#L856, where it stringifies the individual columns names withstr(which fails on python 2 with unicode).