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

Dataframes with wide columns have poor plain/text representations #1272

Closed
cstjean opened this issue Nov 6, 2017 · 3 comments
Closed

Dataframes with wide columns have poor plain/text representations #1272

cstjean opened this issue Nov 6, 2017 · 3 comments
Labels
Milestone

Comments

@cstjean
Copy link
Contributor

cstjean commented Nov 6, 2017

On a regular 80-column-wide terminal, printing a dataframe with a wide column yields this:

julia> DataFrame(name=["Tom", "Eric", "Adolph Blaine Charles David Earl Frederick Gerald Hubert Irvin John Kenneth Lloyd Martin Nero Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus"], age=[10, 20, 30])
3×2 DataFrames.DataFrame
│ Row │ ├─────┼
│ 1   │ │ 2   │ │ 3   │ 

│ Row │ name                                                                                                                                                                              │
├─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 1"Tom"                                                                                                                                                                             │
│ 2"Eric"                                                                                                                                                                            │
│ 3"Adolph Blaine Charles David Earl Frederick Gerald Hubert Irvin John Kenneth Lloyd Martin Nero Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus" │

│ Row │ age │
├─────┼─────┤
│ 110  │
│ 220  │
│ 330

For comparison, pandas:

                                                name  age
0                                                Tom   10
1                                               Eric   20
2  Adolph Blaine Charles David Earl Frederick Ger...   30

Issues:

  1. The first table looks irrelevant?
  2. The second table doesn't respect the 80 characters limit.
  3. I've seen some of the discussion behind splitting big dataframes into several tables, but perhaps the current show behavior would be more appropriate for showall?
@nalimilan
Copy link
Member

Thanks to @bkamins it's better on master, though there's still the same visual glitch with the header:

julia> DataFrame(name=["Tom", "Eric", "Adolph Blaine Charles David Earl Frederick Gerald Hubert Irvin John Kenneth Lloyd Martin Nero Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus"], age=[10, 20, 30])
3×2 DataFrames.DataFrame. Omitted printing of 2 columns
│ Row │ ├─────┼
│ 1   │ │ 2   │ │ 3

showall can be used to print everything, but it's not pretty. It would certainly make sense to truncate columns at a given proportion of the display size, like Pandas.

@swt30
Copy link

swt30 commented Nov 27, 2017

R's tibbles also print an extra line at the end that lists the omitted columns

... with N more variables: colName <type>, colName <type>...

which is quite nice.

@bkamins bkamins mentioned this issue Jan 15, 2019
31 tasks
@bkamins bkamins added the breaking The proposed change is breaking. label Feb 12, 2020
@bkamins bkamins added this to the 2.0 milestone Feb 12, 2020
@bkamins bkamins added display and removed breaking The proposed change is breaking. labels Aug 7, 2020
@bkamins
Copy link
Member

bkamins commented Sep 15, 2020

fixed on master

@bkamins bkamins closed this as completed Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants