Repository navigation
Show a DataFrame columns.name in the index header. - #467
Open
Cherith1222 wants to merge 1 commit into
Open
Cherith1222 wants to merge 1 commit into
Cherith1222 wants to merge 1 commit into
Conversation
Pandas prints columns.name in that corner when the index has no name. Tabulate only copied index.name, so the corner stayed blank. AI-assisted (Cursor). Not yet reviewed by a human.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #259.
A pandas DataFrame with
columns.nameset and noindex.nameprints that columns name in the corner header.tabulatedropped it, so the header cell was blank.columns.nameis used only whenindex.nameis missing. An explicit index name still wins.showindex=Falsedoes not print either name.Tests, on Windows with Python 3.13 and pandas, via Resource Sentinel (1 CPU, 1.5 GiB, 1 I/O):
tabulate/__init__.pychecked out at upstreammaster,test/test_input.py -k test_pandas_columns_name_shown_when_index_unnamedfailed. The header was| | a | b |.ruff0.15.4checkandformat --checkpassed ontabulate/__init__.pyandtest/test_input.py. That is the version pinned in pre-commit. A newerruff checkstill reports existing findings on lines this diff does not touch; those lines were left as they are.Not run: the full suite, an environment without pandas, and anything other than Windows.
CHANGELOGonly lists released versions, so this branch does not add an entry.Drafted with Cursor. A human has not line-reviewed the diff. There is no Co-authored-by or Signed-off-by trailer.