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

ENH: Fixed the shifted column names in summary.to_latex() #6900

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

bashtage
Copy link
Member

Fix header alignment to prevent extra table

Notes:

  • It is essential that you add a test when making code changes. Tests are not
    needed for doc changes.
  • When adding a new function, test values should usually be verified in another package (e.g., R/SAS/Stata).
  • When fixing a bug, you must add a test that would produce the bug in master and
    then show that it is fixed with the new code.
  • New code additions must be well formatted. Changes should pass flake8. If on Linux or OSX, you can
    verify you changes are well formatted by running
    git diff upstream/master -u -- "*.py" | flake8 --diff --isolated
    
    assuming flake8 is installed. This command is also available on Windows
    using the Windows System for Linux once flake8 is installed in the
    local Linux environment. While passing this test is not required, it is good practice and it help
    improve code quality in statsmodels.
  • Docstring additions must render correctly, including escapes and LaTeX.

Fix header alignment to prevent extra table
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.006%) to 88.134% when pulling 4e8681f on bashtage:Jimmy2027_fixing_col_Names into ebe5e76 on statsmodels:master.

@bashtage bashtage merged commit 69cc8d4 into statsmodels:master Jul 21, 2020
@bashtage bashtage deleted the Jimmy2027_fixing_col_Names branch July 21, 2020 10:19
@@ -582,6 +582,7 @@ def _df_to_simpletable(df, align='r', float_format="%.4f", header=True,
st = SimpleTable(np.array(dat), headers=headers, stubs=stubs,
ltx_fmt=fmt_latex, txt_fmt=fmt_txt)
st.output_formats['latex']['data_aligns'] = align
st.output_formats['latex']['header_align'] = align
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this line solve the problem of the shifted column names? I have tried it, but the problem described in #6896 remains

@bashtage
Copy link
Member Author

It fixes is on master.

@bashtage
Copy link
Member Author

Not the most beautiful but the headers are aligned.

image

@bashtage
Copy link
Member Author

The extra hline is uggo though.

@Jimmy2027
Copy link
Contributor

It works for me too in master, thanks! I proposed to remove the hline in #6905

@bashtage bashtage added this to the 0.12 milestone Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants