Skip to content
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

DataFrame.to_latex(): bold_rows option is disregarded #16707

Closed
kdebrab opened this issue Jun 15, 2017 · 0 comments · Fixed by #16708
Closed

DataFrame.to_latex(): bold_rows option is disregarded #16707

kdebrab opened this issue Jun 15, 2017 · 0 comments · Fixed by #16708
Labels
Bug IO LaTeX to_latex Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@kdebrab
Copy link
Contributor

kdebrab commented Jun 15, 2017

Code Sample, a copy-pastable example if possible

import pandas as pd
df = pd.DataFrame({'acol':['a', 'aa'], 'bcol':['b', 'bb']}, index=['row1', 'row2'])
print df.to_latex(bold_rows=True)
\begin{tabular}{lll}
\toprule
{} & acol & bcol \\
\midrule
row1 &    a &    b \\
row2 &   aa &   bb \\
\bottomrule
\end{tabular}

Problem description

Despite bold_rows is documented to be an option of to_latex() and to be True by default, in reality, this option has no effect. Moreover, the current behaviour corresponds with what would be expected for bold_rows=False and is thus in contrast with the documented default 'bold_rows=True' behaviour.

Expected Output

\begin{tabular}{lll}
\toprule
{} & acol & bcol \\
\midrule
\textbf{row1} &    a &    b \\
\textbf{row2} &   aa &   bb \\
\bottomrule
\end{tabular}

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.9.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-78-generic
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.20.2
pytest: None
pip: 9.0.1
setuptools: 36.0.1
Cython: 0.25.2
numpy: 1.13.0
scipy: 0.19.0
xarray: None
IPython: 5.4.1
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: 1.2.1
tables: None
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: 2.4.8
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: None
lxml: 3.8.0
bs4: 4.6.0
html5lib: 0.999999999
sqlalchemy: 1.1.10
pymysql: 0.7.11.None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None

@chris-b1 chris-b1 added Bug IO LaTeX to_latex Output-Formatting __repr__ of pandas objects, to_string labels Jun 15, 2017
@chris-b1 chris-b1 added this to the Next Major Release milestone Jun 15, 2017
@jreback jreback modified the milestones: 0.20.3, Next Major Release Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO LaTeX to_latex Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants