EHN encoding parameter for to_latex #11914
Closed
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
closes #7061
I'm working on solving issue #7061: currently, with Python 2 it is not possible to use
.to_latex()when the dataframe contains utf-8 strings. This PR adds anencodingparameter to make it possible.The work is not completely done though, and I'm making this PR to start a discussion here. In its current state, the PR quickly fixes the issue and provides tests, so it is kind of a minimal PR.
@jreback in the discussion on issue #7061, you made the following suggestion:
I would be glad to work in that direction, but I'm a bit confused by the current organization of the code. This
LatexFormatterwould seem to me to be similar toHTMLFormatter, which inherits fromTableFormatter(exactly asDataFrameFormatter). In that case,DataFrameFormatterwould useLatexFormatterfor.to_latex()exactly as it usesHTMLFormatterfor.to_html(). Is that what you had in mind?