-
- Notifications
You must be signed in to change notification settings - Fork 19.3k
Fixed LatexFormatter with MultIndex index #15479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed LatexFormatter with MultIndex index #15479
Conversation
Used the index formatter to correctly sparsify the MultiIndex for `to_latex()`
| Tests will go in Could you also post screen shots of the output before and after your fix? A release note too in |
| this is going to need tests |
| can you rebase / update |
| can you add the test from the issue? and a whatsnew note (bug fixes is fine). tests are now in |
| I merged from |
| Yes, I should be able to generate the test pretty easily. I'll let you know if I need more help. |
| @agartland yep, that's what I meant. |
| can you rebase / update |
| @agartland we're releasing 0.20.2 in a few days, if you want to rebase and update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a test & whatsnew note.
…g_latex_formatter_sparsify
| Looks like m patch broke these two tests: They both fail because they expect a black value to look like: I'm not sure if there's a difference in Latex for these two. The |
| @agartland the outputs do look the same to be. Could you do a bit of digging to see who's inserting the I think https://travis-ci.org/pandas-dev/pandas/jobs/238131999#L1144 is a real failure though? Here it is, using pandoc, assuming I copy-pasted correctly: |
| closing as stale. if you want to update. pls comment. |



Used
MultiIndex.formatter()to correctly sparsify the index forto_latex().I was having an issue with printing Latex tables. This can be seen in the comparison of
to_string()andto_latex()for the following table. Notice that the first row ofVol8should not be missing any labels because it marks a new label in the outermost level. This is correct into_stringand incorrect into_latex.Output of
to_string():Output of
to_latex():I've tested the relevant pieces of this code using this example, but I would be grateful for help with adding tests to the repository. I'm not set up to develop the
pandascodebase currently and am not exactly sure how to add the right tests in the right places. Thanks!git diff upstream/master | flake8 --diff