E673 EHN: `df.to_latex(escape=True)` also escape index names by quangngd · Pull Request #61307 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

EHN: df.to_latex(escape=True) also escape index names #61307

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add ref to issues
  • Loading branch information
quangngd committed Apr 19, 2025
commit 292b86574c0c7e2c7f9864c294b1524643be5b2b
3 changes: 3 additions & 0 deletions pandas/tests/io/formats/test_to_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,9 @@ def test_to_latex_escape_special_chars(self):
assert result == expected

def test_to_latex_escape_special_chars_in_index_names(self):
# https://github.com/pandas-dev/pandas/issues/61309
# https://github.com/pandas-dev/pandas/issues/57362

index = "&%$#_{}}~^\\"
df = DataFrame({index: [1, 2, 3]}).set_index(index)
result = df.to_latex(escape=True)
Expand Down
Loading
0