Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Unicode handling in `to_latex`. Needs encoding? #7061
Comments
jseabold
added the
Data IO
label
May 6, 2014
|
Can pass a StringIO instance to buf, then encode and write this yourself as a workaround. |
|
Works correctly in python 3 as well. I've got a fix that seems to work for python 2. Changing with open(self.buf, 'w') as f:
write(f, frame, column_format, strcols, longtable)to import codecs
with codecs.open(self.buf, 'wb', encoding=encoding) as f:
write(f, frame, column_format, strcols, longtable)along with adding an encoding kwarg to |
|
Yes, I'm slowly trying to move to python 3 partially for this reason. That seems reasonable to me. I assumed that the other functions just encoded the unicode/string according to the given The default in |
jreback
added Output-Formatting Unicode
labels
May 7, 2014
jreback
added this to the
0.15.0
milestone
May 7, 2014
jreback
modified the milestone: 0.16.0, Next Major Release
Mar 3, 2015
jorisvandenbossche
added IO LaTeX and removed Output-Formatting
labels
Aug 22, 2015
|
I just encountered the same problem with pandas 0.17, so I guess the fix has not been included? @TomAugspurger do you intent on making a PR? |
|
I never got around to submitting a pull request. Feel free to do so if you want! My fix above might work (would need to be tested), but it might be better to tie this in with how |
|
Good point. On the same vein, I just noticed that the I'll have a look. |
|
There’s a possibility that we’ll be able to replace some of the
|
|
Considering this, and your previous remark, and the simplicity of your solution, I'll just implement the latter. But the |
|
@nbonnotte yes, this just requires a |
jreback
modified the milestone: 0.18.0, Next Major Release
Jan 11, 2016
nbonnotte
referenced
this issue
Jan 13, 2016
Closed
ENH missing decimal parameter in .to_latex and .to_html #12031
jreback
added a commit
that referenced
this issue
Jan 15, 2016
|
|
nbonnotte + jreback |
3a832df
|
|
closed by #11914 |
jseabold commentedMay 6, 2014
I can't seem to get this one to work and
to_latexdoesn't allow a user-specified encoding. I think this might need a look.I have it in unicode, so try that way.
Nope. Ok, so let's encode it as a utf-8 string
Nope. It looks like it's getting coerced back to unicode in formatter._to_str_columns() then tries to write it as ASCII...