-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Adding \cline
s to LaTeX table if index is not output
#59877
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
Comments
Thanks for the the report. The argument is documented as:
As such, I do not believe it is a bug when you have no index labels. I'm reworking this issue as a feature request. At a glance, it seems to make sense to have cc @attack68 for any thoughts. |
\cline
s to LaTeX table doesn't work if index is not output\cline
s to LaTeX table if index is not output
I would agree. If this isnt possible already it probably should be if the index is hidden. From memory this was quite complicated though when accounting for (and testing) different cases with hidden indexes and or hidden columns. |
Thanks @attack68 - I think PRs to implement this are welcome! |
…as-dev#59877] - implement a new suffix for the `clines` option, `-invisible`, doubling the number of available options, specifying that hidden indices should be included when deciding whether to add \clines - add tests for this behaviour
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
I am trying to output a LaTeX table with groups separated by
\cline
s but where the grouping variable is not shown in the table. I had thought that having the grouping in the index, but hiding the index in the output table, would allow this to happen; however, instead specifyingclines="all;data"
does nothing when the index is hidden.Expected Behavior
I would expect the example above to output
Currently it outputs
(Ideally I would want it to output
but there is a problem with the way that I am creating the index, which is unrelated to the issue at hand.)
Installed Versions
INSTALLED VERSIONS
commit : 71b395f
python : 3.12.6
python-bits : 64
OS : Darwin
OS-release : 23.6.0
Version : Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 3.0.0.dev0+1497.g71b395f2cf
numpy : 2.1.1
dateutil : 2.9.0.post0
pip : 24.2
Cython : None
sphinx : None
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
blosc : None
bottleneck : None
fastparquet : None
fsspec : None
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
psycopg2 : None
pymysql : None
pyarrow : None
pyreadstat : None
pytest : None
python-calamine : None
pytz : 2024.2
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: