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

Addtional horizontal lines to create sections within a table #148

Open
borderite opened this issue Oct 30, 2021 · 2 comments
Open

Addtional horizontal lines to create sections within a table #148

borderite opened this issue Oct 30, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@borderite
Copy link

borderite commented Oct 30, 2021

Is your feature request related to a problem? Please describe.

I often want to make groups of rows in a table. To indicate the grouping, I want to put a horizontal line between each pair of the adjacent row groups.

Describe the solution you'd like

It would be great if I could place a horizontal line after any row I pick (or before any row I pick).

Describe alternatives you've considered

The python package, rich, let me do what I would like to do (by using "end_section") when I want text outputs. But rich does not offer a method like get_latex_string.

Additional context

Here is an example of text outputs I desire to get. The horizontal line right above "Summary Statistics" is the one I cannot get using PrettyTable.

        Dependent variable: birthwdight       
=============================================
                     (1)      (2)      (3)   
---------------------------------------------
Regressor                                    
  smoker            -253.23  -217.58  -175.38
                   (26.801)  (26.09) (26.804)
  alcohol                    -30.491  -21.083
                            (72.548) (72.931)
  nprevist                     34.07   29.603
                            (3.6059) (3.5798)
  unmarried                           -187.13
                                     (27.654)
  const              3432.1   3051.2   3134.4
                   (11.887) (43.685) (44.112)
---------------------------------------------
Summary Statistics                           
  SER                583.73   570.47    565.7
  R-squared        0.028604  0.07285 0.088605
  Adj. R-squared    0.02828 0.071922 0.087388
---------------------------------------------
@zubieta zubieta added the enhancement New feature or request label Nov 16, 2021
@kinredon
Copy link
Contributor

How to use this function?

@hugovk
Copy link
Member

hugovk commented Feb 23, 2022

@kinredon It hasn't been implemented. I would welcome a PR, something similar to Rich's end_section sounds pretty good.

https://rich.readthedocs.io/en/stable/reference/table.html#rich.table.Row

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants