-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
to_latex wrong \multicolumn count #17959
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
I'm not sure that should be the case...that being said, feel free to investigate and figure out the cause. |
pandas/pandas/io/formats/format.py Line 945 in 3c964a4
line 945, the 3 is fixed, it might should be len(rows)
The testcase says also 3 line
If I change it the test won't work but I dont think that the test is correct. |
Not sure why we are using hard-coded values. Let's change to it (both in the source code and tests) to vary, and let's see how the output looks like when we do that. (BTW, when I say "see how the output looks", I mean that we should also make sure that it renders properly when converted to PDF for example - that would have to be done somewhat manually) |
pandas.DataFrame.to_latex(longtable=True) always contained \multicolumn{3}{r}{{Continued on next page}} regardless of the number of columns in the output.
is this issue related: #14484 |
@jreback : Not as far as I can tell. |
pandas.DataFrame.to_latex(longtable=True) always contained \multicolumn{3}{r}{{Continued on next page}} regardless of the number of columns in the output.
pandas.DataFrame.to_latex(longtable=True) always contained \multicolumn{3}{r}{{Continued on next page}} regardless of the number of columns in the output.
pandas.DataFrame.to_latex(longtable=True) always contained \multicolumn{3}{r}{{Continued on next page}} regardless of the number of columns in the output.
closes pandas-dev#17959 (cherry picked from commit e909ea0)
Version 0.22.0 * tag 'v0.22.0': (777 commits) RLS: v0.22.0 DOC: Fix min_count docstring (pandas-dev#19005) DOC: More 0.22.0 updates (pandas-dev#19002) TST: Remove pow test in expressions COMPAT: Avoid td.skip decorator DOC: 0.22.0 release docs (pandas-dev#18983) DOC: Include 0.22.0 whatsnew Breaking changes for sum / prod of empty / all-NA (pandas-dev#18921) ENH: Added a min_count keyword to stat funcs (pandas-dev#18876) RLS: v0.21.1 DOC: Add date to whatsnew (pandas-dev#18740) DOC: Include 0.21.1 whatsnew DOC: Update relase notes (pandas-dev#18739) CFG: Ignore W503 DOC: fix options table (pandas-dev#18730) ENH: support non default indexes in writing to Parquet (pandas-dev#18629) BUG: Fix to_latex with longtable (pandas-dev#17959) (pandas-dev#17960) Parquet: Add error message for no engine found (pandas-dev#18717) BUG: Categorical data fails to load from hdf when all columns are NaN (pandas-dev#18652) DOC: clean-up whatsnew file for 0.21.1 (pandas-dev#18690) ...
* releases: (777 commits) RLS: v0.22.0 DOC: Fix min_count docstring (pandas-dev#19005) DOC: More 0.22.0 updates (pandas-dev#19002) TST: Remove pow test in expressions COMPAT: Avoid td.skip decorator DOC: 0.22.0 release docs (pandas-dev#18983) DOC: Include 0.22.0 whatsnew Breaking changes for sum / prod of empty / all-NA (pandas-dev#18921) ENH: Added a min_count keyword to stat funcs (pandas-dev#18876) RLS: v0.21.1 DOC: Add date to whatsnew (pandas-dev#18740) DOC: Include 0.21.1 whatsnew DOC: Update relase notes (pandas-dev#18739) CFG: Ignore W503 DOC: fix options table (pandas-dev#18730) ENH: support non default indexes in writing to Parquet (pandas-dev#18629) BUG: Fix to_latex with longtable (pandas-dev#17959) (pandas-dev#17960) Parquet: Add error message for no engine found (pandas-dev#18717) BUG: Categorical data fails to load from hdf when all columns are NaN (pandas-dev#18652) DOC: clean-up whatsnew file for 0.21.1 (pandas-dev#18690) ...
Code Sample
Problem description
It says
\multicolumn{3}
but it should be 2, it only fails withlongtable=True
. Indeed it always writes 3 no matter what shape the table has.Expected Output
Output of
pd.show_versions()
pandas: 0.20.1
pytest: None
pip: 9.0.1
setuptools: 20.7.0
Cython: None
numpy: 1.12.1
scipy: 0.19.0
xarray: None
IPython: 6.1.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2013b
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.0.0
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.7.3
lxml: None
bs4: None
html5lib: 0.999999999
sqlalchemy: None
pymysql: None
psycopg2: 2.7.1 (dt dec pq3 ext lo64)
jinja2: 2.8
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: