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

Bool columns are printed as 0/1 in HTML, but not in plain #3265

Closed
bkamins opened this issue Jan 3, 2023 · 3 comments
Closed

Bool columns are printed as 0/1 in HTML, but not in plain #3265

bkamins opened this issue Jan 3, 2023 · 3 comments
Assignees
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented Jan 3, 2023

Example:

julia> df = DataFrame(
           condition = [false, false, true, false, false, false, true, false, false, false],
           time = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
10×2 DataFrame
 Row │ condition  time
     │ Bool       Int64
─────┼──────────────────
   1 │     false      1
   2 │     false      2
   3 │      true      3
   4 │     false      4
   5 │     false      5
   6 │     false      6
   7 │      true      7
   8 │     false      8
   9 │     false      9
  10 │     false     10

julia> PrettyTables.pretty_table(df)
┌───────────┬───────┐
│ condition │  time │
│      Bool │ Int64 │
├───────────┼───────┤
│     false │     1 │
│     false │     2 │
│      true │     3 │
│     false │     4 │
│     false │     5 │
│     false │     6 │
│      true │     7 │
│     false │     8 │
│     false │     9 │
│     false │    10 │
└───────────┴───────┘

vs
image

@ronisbr - I think it is a bug, but can you please confirm?

@bkamins bkamins added this to the patch milestone Jan 3, 2023
@bkamins bkamins added the bug label Jan 3, 2023
@bkamins bkamins added the display label Jan 3, 2023
@bkamins
Copy link
Member Author

bkamins commented Jan 3, 2023

and
image

@ronisbr
Copy link
Member

ronisbr commented Jan 4, 2023

Hi @bkamins !

I cannot reproduce this bug:

Captura de Tela 2023-01-03 às 22 40 03

Furthermore, your display seems wrong. Notice that we added the title "Row" in the row number column, and the text above the DataFrame must be 10 x 2 DataFrame instead of 10 rows x 2 columns. Can it be an environment problem with old versions of packages?

@bkamins
Copy link
Member Author

bkamins commented Jan 4, 2023

Right, on 1.4 branch all is good

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

No branches or pull requests

2 participants