Skip to content
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

Fix Bug: last column missing formatting in Latex (#52218) #60356

Merged
merged 13 commits into from
Nov 21, 2024

Conversation

corbanvilla
Copy link
Contributor

@corbanvilla corbanvilla commented Nov 18, 2024

Redo of #60239 but using a feature branch this time :-)

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

pandas/io/formats/style_render.py Outdated Show resolved Hide resolved
@rhshadrach rhshadrach added IO LaTeX to_latex Bug Styler conditional formatting using DataFrame.style labels Nov 18, 2024
fix backticks
@@ -48,6 +48,8 @@ These are bug fixes that might have notable behavior changes.

.. _whatsnew_230.notable_bug_fixes.notable_bug_fix1:

- The ``to_latex`` function is now fixed for hidden multiindex dataframes (:issue:`52218`)
Copy link
Contributor

@attack68 attack68 Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is the right place for this, and its a bit misleading as well. I would write.

...to_latex styling of column headers when combined with a hidden index or hidden index-levels is fixed...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@attack68 Ah didn't see the general bug fixes section... moved and reworded 👍

@attack68
Copy link
Contributor

Ok I looked a little more at this. The original problem was phrased as not applying to the last column for a styling function that should apply to the whole row. However that isn't really the nature of the problem.

E.g.
Screenshot 2024-11-19 at 20 36 18

Notice that Latex translate seems to get out of line for hidden columns.

Co-authored-by: JHM Darbyshire <[email protected]>
@corbanvilla
Copy link
Contributor Author

Ok I looked a little more at this. The original problem was phrased as not applying to the last column for a styling function that should apply to the whole row. However that isn't really the nature of the problem.
....

Ah interesting... that makes sense.

Copy link
Contributor

@attack68 attack68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -73,6 +73,8 @@ Performance improvements
Bug fixes
~~~~~~~~~

- The ``to_latex`` styling of column headers when combined with a hidden index or hidden index-levels is fixed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this to v3.0.0.rst?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

@mroeschke mroeschke added this to the 3.0 milestone Nov 21, 2024
@mroeschke mroeschke merged commit 72bd17c into pandas-dev:main Nov 21, 2024
51 checks passed
@mroeschke
Copy link
Member

Thanks @corbanvilla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO LaTeX to_latex Styler conditional formatting using DataFrame.style
Projects
None yet
4 participants