-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_latex outputs string with missing second index level values #14484
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
Labels
Milestone
Comments
@the-alleged-car That indeed looks like a bug in the multi-index handling (not printing consecutive values should only happen for the same values of the previous level). Thanks for the report! Smaller reproducible example:
|
@the-alleged-car If you want to take a look how to fix it, always welcome! |
4 tasks
This just bit me as well. |
gfyoung
added a commit
to forking-repos/pandas
that referenced
this issue
Dec 8, 2017
TomAugspurger
pushed a commit
to TomAugspurger/pandas
that referenced
this issue
Dec 8, 2017
* BUG: LatexFormatter.write_result multi-index Fixed GH issue 14484: `LatexFormatter.write_result`` now does not print blanks if a higher-order index differs from the previous row. Also added testcase for this. * MAINT: Address reviewer comments Closes pandas-devgh-14484 Closes pandas-devgh-17499
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using pandas to generate a LaTeX string using the to_latex() method on a DataFrame, which is indexed using a MultiIndex object. Running the code snippet produces an incorrect list of strings: the LaTeX table is missing two index numbers.
Code Snippet
Incorrect Output
Correct Output
Note that in the correct output LaTeX strings, the rows with indices (38661, 85) and (41231, 85) correctly include the second index (the number 85), but in the incorrect LaTeX strings the rows do not include the number 85.
Could this be because the row (23240, 85) above (38661, 85) includes 85 in its second index?
pandas: 0.18.1
nose: 1.3.7
pip: 8.1.2
setuptools: 23.0.0
Cython: 0.24
numpy: 1.11.1
scipy: 0.17.1
statsmodels: 0.6.1
xarray: None
IPython: 4.2.0
sphinx: 1.4.1
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.0
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.2
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: 0.7.6.None
psycopg2: None
jinja2: 2.8
boto: 2.40.0
pandas_datareader: None
The text was updated successfully, but these errors were encountered: