Title: Separating lines break sized row indices and shift DataFrame labels · Issue #464 · astanin/python-tabulate · GitHub
Open Graph Title: Separating lines break sized row indices and shift DataFrame labels · Issue #464 · astanin/python-tabulate
X Title: Separating lines break sized row indices and shift DataFrame labels · Issue #464 · astanin/python-tabulate
Description: showindex supplied as a list or tuple counts separating lines as data rows during length validation. The equivalent iterator succeeds. Separating lines should not consume row index values. Reproducer against current master: from tabulate...
Open Graph Description: showindex supplied as a list or tuple counts separating lines as data rows during length validation. The equivalent iterator succeeds. Separating lines should not consume row index values. Reproduc...
X Description: showindex supplied as a list or tuple counts separating lines as data rows during length validation. The equivalent iterator succeeds. Separating lines should not consume row index values. Reproduc...
Opengraph URL: https://github.com/astanin/python-tabulate/issues/464
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Separating lines break sized row indices and shift DataFrame labels","articleBody":"`showindex` supplied as a list or tuple counts separating lines as data rows during length validation. The equivalent iterator succeeds. Separating lines should not consume row index values.\n\nReproducer against current master:\n\n```python\nfrom tabulate import SEPARATING_LINE, tabulate\n\nrows = [[\"a\"], SEPARATING_LINE, [\"b\"]]\nprint(tabulate(rows, showindex=iter([10, 20]), tablefmt=\"grid\")) # succeeds\nprint(tabulate(rows, showindex=[10, 20], tablefmt=\"grid\")) # ValueError\n```\n\nThe list raises `ValueError: index must be as long as the number of data rows: len(index)=2 len(rows)=3`. Conversely, a list of three IDs succeeds but silently drops its last ID. There are only two data rows.\n\nThe same counting problem affects a DataFrame's own index labels when a separator row is present:\n\n```python\nimport pandas as pd\n\nframe = pd.DataFrame(\n [[\"a\", 1], [SEPARATING_LINE, None], [\"b\", 2]],\n index=[\"row-a\", \"separator\", \"row-b\"],\n)\nprint(tabulate(frame, tablefmt=\"grid\"))\n```\n\nThe final data row gets the label `separator` rather than `row-b`. Its original label should stay attached to that row.\n\nI reproduced these cases locally on Windows/Python 3.13 and prepared a small fix with public regression tests. AI assistance was used for investigation and review; the reproductions and tests were executed locally.","author":{"url":"https://github.com/kokotatan","@type":"Person","name":"kokotatan"},"datePublished":"2026-10-03T15:03:41Z","url":"https://github.com/astanin/python-tabulate/issues/464"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fa7b235b-d220-5748-351b-a62ea09bf148 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB8A:323EE8:9F80A3:D92D9E:6AFF3ECD |
| html-safe-nonce | 81cfd3b53dba43f986305fd8ea857ea052f12ea238e8b48826db4079b728cf77 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjhBOjMyM0VFODo5RjgwQTM6RDkyRDlFOjZBRkYzRUNEIiwidmlzaXRvcl9pZCI6IjE2NDY1NTQ2ODE5ODU0MTY5MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 89fdf23b01abfc8329e8bcff2e0acdf77554763978d2271d3480b2a913b5fd58 |
| hovercard-subject-tag | issue:5690788368 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/astanin/python-tabulate/464/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34529788ad65aaf827e4de385fc3d6509eda2994ef9dd2bef5806186bf982cd0/astanin/python-tabulate/issues/464 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34529788ad65aaf827e4de385fc3d6509eda2994ef9dd2bef5806186bf982cd0/astanin/python-tabulate/issues/464 |
| og:image:alt | showindex supplied as a list or tuple counts separating lines as data rows during length validation. The equivalent iterator succeeds. Separating lines should not consume row index values. Reproduc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kokotatan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 07f40d184b74ca701a2005d4a164bf7038be26fc145c2623336a91fe477cc584 |
| turbo-cache-control | no-preview |
| go-import | github.com/astanin/python-tabulate git https://github.com/astanin/python-tabulate.git |
| octolytics-dimension-user_id | 71802 |
| octolytics-dimension-user_login | astanin |
| octolytics-dimension-repository_id | 205875548 |
| octolytics-dimension-repository_nwo | astanin/python-tabulate |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205875548 |
| octolytics-dimension-repository_network_root_nwo | astanin/python-tabulate |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8e428a801c2dccf4d1f411040a0e0b7fab7d4061 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width