I am doing some exploration on the screen for my dataframe with about 10 columns. Is there a way to print the table on the screen with horizontal line for every row just like a latex table? I could not find this option in the show() of DataFrame. Thanks.
If you use VSCode you can click on the data panel for the variable of interest and an Excel-like table will open letting you visualize all cols and all rowsβ¦
Consider also using PrettyTables.jl
Or in other words:
show
for data frame help lists only most common options (as there are too many to list)show
supports all options of PrettyTables.jl
CC @Ronis_BR
Yes!
You can have all the lines you want:
julia> df = DataFrame(rand(10,10), :auto)
10Γ10 DataFrame
Row β x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
β Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β 0.0716389 0.784066 0.374627 0.493523 0.675171 0.938887 0.701512 0.541908 0.937989 0.697233
2 β 0.624784 0.513396 0.606176 0.515935 0.432444 0.671839 0.683243 0.649663 0.869727 0.730778
3 β 0.840183 0.642296 0.022753 0.14086 0.827733 0.0803897 0.416368 0.150438 0.0195389 0.22608
4 β 0.971794 0.197491 0.448072 0.186049 0.609802 0.286922 0.260894 0.765768 0.499115 0.308511
5 β 0.0373043 0.0894055 0.186157 0.093386 0.844163 0.955461 0.0799212 0.169375 0.922238 0.361566
6 β 0.968046 0.713258 0.463439 0.707651 0.739382 0.59466 0.355122 0.499858 0.916289 0.209395
7 β 0.0928419 0.82223 0.826998 0.938195 0.300713 0.170391 0.69201 0.384293 0.108959 0.460362
8 β 0.391558 0.590709 0.772016 0.111373 0.529959 0.785472 0.00606464 0.534936 0.662282 0.0748498
9 β 0.741088 0.0563262 0.472633 0.558224 0.354916 0.90828 0.783904 0.252325 0.901037 0.360539
10 β 0.686781 0.587165 0.00686523 0.624827 0.478205 0.127479 0.345735 0.764431 0.180345 0.0421078
julia> show(df; hlines = :all, vlines = :all)
10Γ10 DataFrame
βββββββ¬ββββββββββββ¬ββββββββββββ¬βββββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββ¬βββββββββββββ¬βββββββββββ¬ββββββββββββ¬ββββββββββββ
β Row β x1 β x2 β x3 β x4 β x5 β x6 β x7 β x8 β x9 β x10 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β β Float64 β Float64 β Float64 β Float64 β Float64 β Float64 β Float64 β Float64 β Float64 β Float64 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 1 β 0.0716389 β 0.784066 β 0.374627 β 0.493523 β 0.675171 β 0.938887 β 0.701512 β 0.541908 β 0.937989 β 0.697233 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 2 β 0.624784 β 0.513396 β 0.606176 β 0.515935 β 0.432444 β 0.671839 β 0.683243 β 0.649663 β 0.869727 β 0.730778 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 3 β 0.840183 β 0.642296 β 0.022753 β 0.14086 β 0.827733 β 0.0803897 β 0.416368 β 0.150438 β 0.0195389 β 0.22608 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 4 β 0.971794 β 0.197491 β 0.448072 β 0.186049 β 0.609802 β 0.286922 β 0.260894 β 0.765768 β 0.499115 β 0.308511 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 5 β 0.0373043 β 0.0894055 β 0.186157 β 0.093386 β 0.844163 β 0.955461 β 0.0799212 β 0.169375 β 0.922238 β 0.361566 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 6 β 0.968046 β 0.713258 β 0.463439 β 0.707651 β 0.739382 β 0.59466 β 0.355122 β 0.499858 β 0.916289 β 0.209395 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 7 β 0.0928419 β 0.82223 β 0.826998 β 0.938195 β 0.300713 β 0.170391 β 0.69201 β 0.384293 β 0.108959 β 0.460362 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 8 β 0.391558 β 0.590709 β 0.772016 β 0.111373 β 0.529959 β 0.785472 β 0.00606464 β 0.534936 β 0.662282 β 0.0748498 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 9 β 0.741088 β 0.0563262 β 0.472633 β 0.558224 β 0.354916 β 0.90828 β 0.783904 β 0.252325 β 0.901037 β 0.360539 β
βββββββΌββββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββΌβββββββββββββΌβββββββββββΌββββββββββββΌββββββββββββ€
β 10 β 0.686781 β 0.587165 β 0.00686523 β 0.624827 β 0.478205 β 0.127479 β 0.345735 β 0.764431 β 0.180345 β 0.0421078 β
βββββββ΄ββββββββββββ΄ββββββββββββ΄βββββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββββ΄βββββββββββββ΄βββββββββββ΄ββββββββββββ΄ββββββββββββ
P.S.: @bkamins just one more reminder about how important that manual section on output customization is I am writing it, but I am having problems to find a balance between a huge and difficult to read section, and a more simple but without taking into account all the possibilities. Maybe the best thing is to start with the later and discuss in the PRβ¦
Ah, and if you want only the horizontal lines, you can do:
julia> show(df; hlines = :all)
10Γ10 DataFrame
ββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Row β x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 β 0.0716389 0.784066 0.374627 0.493523 0.675171 0.938887 0.701512 0.541908 0.937989 0.697233
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2 β 0.624784 0.513396 0.606176 0.515935 0.432444 0.671839 0.683243 0.649663 0.869727 0.730778
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3 β 0.840183 0.642296 0.022753 0.14086 0.827733 0.0803897 0.416368 0.150438 0.0195389 0.22608
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
4 β 0.971794 0.197491 0.448072 0.186049 0.609802 0.286922 0.260894 0.765768 0.499115 0.308511
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5 β 0.0373043 0.0894055 0.186157 0.093386 0.844163 0.955461 0.0799212 0.169375 0.922238 0.361566
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
6 β 0.968046 0.713258 0.463439 0.707651 0.739382 0.59466 0.355122 0.499858 0.916289 0.209395
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7 β 0.0928419 0.82223 0.826998 0.938195 0.300713 0.170391 0.69201 0.384293 0.108959 0.460362
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
8 β 0.391558 0.590709 0.772016 0.111373 0.529959 0.785472 0.00606464 0.534936 0.662282 0.0748498
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
9 β 0.741088 0.0563262 0.472633 0.558224 0.354916 0.90828 0.783904 0.252325 0.901037 0.360539
ββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
10 β 0.686781 0.587165 0.00686523 0.624827 0.478205 0.127479 0.345735 0.764431 0.180345 0.0421078
ββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
If you want to remove the vertical line in Row
column, then do:
julia> show(df; hlines = :all, vlines = :none)
10Γ10 DataFrame
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Row x1 x2 x3 x4 x5 x6 x7 x8 x9 x10
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 0.0716389 0.784066 0.374627 0.493523 0.675171 0.938887 0.701512 0.541908 0.937989 0.697233
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2 0.624784 0.513396 0.606176 0.515935 0.432444 0.671839 0.683243 0.649663 0.869727 0.730778
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
3 0.840183 0.642296 0.022753 0.14086 0.827733 0.0803897 0.416368 0.150438 0.0195389 0.22608
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
4 0.971794 0.197491 0.448072 0.186049 0.609802 0.286922 0.260894 0.765768 0.499115 0.308511
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5 0.0373043 0.0894055 0.186157 0.093386 0.844163 0.955461 0.0799212 0.169375 0.922238 0.361566
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
6 0.968046 0.713258 0.463439 0.707651 0.739382 0.59466 0.355122 0.499858 0.916289 0.209395
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
7 0.0928419 0.82223 0.826998 0.938195 0.300713 0.170391 0.69201 0.384293 0.108959 0.460362
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
8 0.391558 0.590709 0.772016 0.111373 0.529959 0.785472 0.00606464 0.534936 0.662282 0.0748498
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
9 0.741088 0.0563262 0.472633 0.558224 0.354916 0.90828 0.783904 0.252325 0.901037 0.360539
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
10 0.686781 0.587165 0.00686523 0.624827 0.478205 0.127479 0.345735 0.764431 0.180345 0.0421078
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Thank you for the answer.
Two packages which may be helpful
- TerminalPager.jl for a scroll-able view of a
DataFrame
- FloatingTableView.jl which opens up a new window for viewing the table.