Inconsistent display of values with DataFrames

I’m not sure if it’s specific to DataFrames.jl but I noticed the following inconsistency:

using DataFrames

julia> d = Dict(i=>DataFrame(a=rand(1000)) for i in 1:10)
Dict{Int64, DataFrame} with 10 entries:
  5  => 1000×1 DataFrame…
  4  => 1000×1 DataFrame…
  6  => 1000×1 DataFrame…
  7  => 1000×1 DataFrame…
  2  => 1000×1 DataFrame…
  10 => 1000×1 DataFrame…
  9  => 1000×1 DataFrame…
  8  => 1000×1 DataFrame…
  3  => 1000×1 DataFrame…
  1  => 1000×1 DataFrame…

but

julia> (d,)
(Dict{Int64, DataFrame}(5 => 1000×1 DataFrame
  Row │ a          
      │ Float64    
──────┼────────────
    1 │ 0.41802
    2 │ 0.779733
    3 │ 0.229668
    4 │ 0.905372
    5 │ 0.26982
    6 │ 0.116318
    7 │ 0.0280336
    8 │ 0.056285
    9 │ 0.317657
   10 │ 0.291885
   11 │ 0.0652153
   12 │ 0.0955505
   13 │ 0.594893
   14 │ 0.677694
   15 │ 0.813648
   16 │ 0.823904
   17 │ 0.346765
   18 │ 0.165566
   19 │ 0.874403
   20 │ 0.523801
   21 │ 0.157975
   22 │ 0.060574
  ⋮   │     ⋮
  979 │ 0.974958
  980 │ 0.792981
  981 │ 0.445162
  982 │ 0.391257
  983 │ 0.482663
  984 │ 0.231736
  985 │ 0.123709
  986 │ 0.246336
  987 │ 0.560529
  988 │ 0.51656
  989 │ 0.13073
  990 │ 0.277065
  991 │ 0.785894
  992 │ 0.033957
  993 │ 0.260038
  994 │ 0.529989
  995 │ 0.317397
  996 │ 0.270399
  997 │ 0.176198
  998 │ 0.768546
  999 │ 0.40685
 1000 │ 0.171345
   956 rows omitted, 4 => 1000×1 DataFrame
  Row │ a         
      │ Float64   
──────┼───────────
    1 │ 0.884719
    2 │ 0.526731
    3 │ 0.530968
    4 │ 0.161457
    5 │ 0.482227
    6 │ 0.605248
    7 │ 0.199243
    8 │ 0.321777
    9 │ 0.749071
   10 │ 0.300044
   11 │ 0.491743
   12 │ 0.106576
   13 │ 0.803167
   14 │ 0.881943
   15 │ 0.725055
   16 │ 0.791473
   17 │ 0.884515
   18 │ 0.694896
   19 │ 0.953231
   20 │ 0.515803
   21 │ 0.681086
   22 │ 0.21962
  ⋮   │     ⋮
  979 │ 0.75346
  980 │ 0.169149
  981 │ 0.382934
  982 │ 0.981802
  983 │ 0.250785
  984 │ 0.023237
  985 │ 0.314874
  986 │ 0.0357615
  987 │ 0.458313
  988 │ 0.934667
  989 │ 0.632718
  990 │ 0.682456
  991 │ 0.193991
  992 │ 0.622768
  993 │ 0.110542
  994 │ 0.312372
  995 │ 0.232448
  996 │ 0.51054
  997 │ 0.702202
  998 │ 0.986539
  999 │ 0.999984
 1000 │ 0.0589873
  956 rows omitted, 6 => 1000×1 DataFrame
  Row │ a          
      │ Float64    
──────┼────────────
    1 │ 0.995477
    2 │ 0.79133
    3 │ 0.344675
    4 │ 0.824139
    5 │ 0.606471
    6 │ 0.824883
    7 │ 0.0816591
    8 │ 0.793531
    9 │ 0.00639504
   10 │ 0.008402
   11 │ 0.813371
   12 │ 0.100345
   13 │ 0.469871
   14 │ 0.314847
   15 │ 0.560575
   16 │ 0.660095
   17 │ 0.0287555
   18 │ 0.649815
   19 │ 0.645335
   20 │ 0.974584
   21 │ 0.780605
   22 │ 0.119297
  ⋮   │     ⋮
  979 │ 0.653419
  980 │ 0.10518
  981 │ 0.837025
  982 │ 0.580397
  983 │ 0.461341
  984 │ 0.0750421
  985 │ 0.940543
  986 │ 0.74425
  987 │ 0.389941
  988 │ 0.982294
  989 │ 0.443358
  990 │ 0.957066
  991 │ 0.0270139
  992 │ 0.811946
  993 │ 0.894975
  994 │ 0.0651442
  995 │ 0.123586
  996 │ 0.648395
  997 │ 0.736289
  998 │ 0.759622
  999 │ 0.321255
 1000 │ 0.261425
   956 rows omitted, 7 => 1000×1 DataFrame
  Row │ a         
      │ Float64   
──────┼───────────
    1 │ 0.295392
    2 │ 0.985383
    3 │ 0.795242
    4 │ 0.8398
    5 │ 0.466804
    6 │ 0.626751
    7 │ 0.624385
    8 │ 0.0984643
    9 │ 0.0892
   10 │ 0.725893
   11 │ 0.952326
   12 │ 0.37944
   13 │ 0.658467
   14 │ 0.718402
   15 │ 0.0582124
   16 │ 0.561241
   17 │ 0.758972
   18 │ 0.0718356
   19 │ 0.904324
   20 │ 0.547329
   21 │ 0.313895
   22 │ 0.967502
  ⋮   │     ⋮
  979 │ 0.871924
  980 │ 0.716794
  981 │ 0.126386
  982 │ 0.299032
  983 │ 0.496768
  984 │ 0.620405
  985 │ 0.511794
  986 │ 0.0394952
  987 │ 0.990808
  988 │ 0.533369
  989 │ 0.779017
  990 │ 0.897386
  991 │ 0.785174
  992 │ 0.169492
  993 │ 0.491071
  994 │ 0.913758
  995 │ 0.96829
  996 │ 0.435205
  997 │ 0.947758
  998 │ 0.745061
  999 │ 0.943903
 1000 │ 0.57667
  956 rows omitted, 2 => 1000×1 DataFrame
  Row │ a          
      │ Float64    
──────┼────────────
    1 │ 0.496462
    2 │ 0.114628
    3 │ 0.269605
    4 │ 0.766674
    5 │ 0.335856
    6 │ 0.101043
    7 │ 0.92797
    8 │ 0.238614
    9 │ 0.512666
   10 │ 0.857494
   11 │ 0.565068
   12 │ 0.122641
   13 │ 0.72179
   14 │ 0.6323
   15 │ 0.631583
   16 │ 0.619971
   17 │ 0.0899199
   18 │ 0.151863
   19 │ 0.110466
   20 │ 0.383768
   21 │ 0.0774877
   22 │ 0.0320006
  ⋮   │     ⋮
  979 │ 0.945187
  980 │ 0.240133
  981 │ 0.286158
  982 │ 0.142457
  983 │ 0.852643
  984 │ 0.338335
  985 │ 0.239666
  986 │ 0.546989
  987 │ 0.220168
  988 │ 0.092782
  989 │ 0.499269
  990 │ 0.168011
  991 │ 0.657144
  992 │ 0.250106
  993 │ 0.156755
  994 │ 0.378545
  995 │ 0.00823771
  996 │ 0.517566
  997 │ 0.340344
  998 │ 0.375727
  999 │ 0.773507
 1000 │ 0.0125711
   956 rows omitted, 10 => 1000×1 DataFrame
  Row │ a         
      │ Float64   
──────┼───────────
    1 │ 0.248515
    2 │ 0.0544953
    3 │ 0.699174
    4 │ 0.0038203
    5 │ 0.617241
    6 │ 0.72455
    7 │ 0.993877
    8 │ 0.882296
    9 │ 0.760833
   10 │ 0.609649
   11 │ 0.608198
   12 │ 0.783065
   13 │ 0.389774
   14 │ 0.782814
   15 │ 0.326328
   16 │ 0.785123
   17 │ 0.527035
   18 │ 0.318062
   19 │ 0.482015
   20 │ 0.708736
   21 │ 0.0534408
   22 │ 0.9858
  ⋮   │     ⋮
  979 │ 0.396197
  980 │ 0.13359
  981 │ 0.7172
  982 │ 0.313971
  983 │ 0.530943
  984 │ 0.313686
  985 │ 0.302241
  986 │ 0.289021
  987 │ 0.481393
  988 │ 0.491383
  989 │ 0.86607
  990 │ 0.410992
  991 │ 0.981065
  992 │ 0.639273
  993 │ 0.240755
  994 │ 0.45824
  995 │ 0.327688
  996 │ 0.375357
  997 │ 0.965788
  998 │ 0.0849657
  999 │ 0.932186
 1000 │ 0.154016
  956 rows omitted, 9 => 1000×1 DataFrame
  Row │ a          
      │ Float64    
──────┼────────────
    1 │ 0.227218
    2 │ 0.498078
    3 │ 0.403385
    4 │ 0.770543
    5 │ 0.540582
    6 │ 0.00469332
    7 │ 0.17531
    8 │ 0.19726
    9 │ 0.461658
   10 │ 0.0637894
   11 │ 0.104463
   12 │ 0.61231
   13 │ 0.0817162
   14 │ 0.757502
   15 │ 0.609495
   16 │ 0.235327
   17 │ 0.464431
   18 │ 0.38866
   19 │ 0.951829
   20 │ 0.797786
   21 │ 0.0721003
   22 │ 0.147927
  ⋮   │     ⋮
  979 │ 0.267644
  980 │ 0.788725
  981 │ 0.977545
  982 │ 0.551499
  983 │ 0.329074
  984 │ 0.810644
  985 │ 0.12422
  986 │ 0.430482
  987 │ 0.689625
  988 │ 0.63144
  989 │ 0.416889
  990 │ 0.420362
  991 │ 0.562757
  992 │ 0.960268
  993 │ 0.114005
  994 │ 0.861329
  995 │ 0.00196556
  996 │ 0.844078
  997 │ 0.0568479
  998 │ 0.419663
  999 │ 0.883169
 1000 │ 0.208861
   956 rows omitted, 8 => 1000×1 DataFrame
  Row │ a         
      │ Float64   
──────┼───────────
    1 │ 0.566089
    2 │ 0.761569
    3 │ 0.323814
    4 │ 0.50719
    5 │ 0.707077
    6 │ 0.570275
    7 │ 0.0386733
    8 │ 0.514324
    9 │ 0.604945
   10 │ 0.284593
   11 │ 0.0385349
   12 │ 0.258131
   13 │ 0.0512277
   14 │ 0.932736
   15 │ 0.370597
   16 │ 0.674175
   17 │ 0.376086
   18 │ 0.158217
   19 │ 0.658446
   20 │ 0.196475
   21 │ 0.817143
   22 │ 0.524178
  ⋮   │     ⋮
  979 │ 0.507153
  980 │ 0.501493
  981 │ 0.147213
  982 │ 0.904608
  983 │ 0.601622
  984 │ 0.735106
  985 │ 0.288588
  986 │ 0.0945622
  987 │ 0.818745
  988 │ 0.354146
  989 │ 0.211322
  990 │ 0.0802996
  991 │ 0.165877
  992 │ 0.111293
  993 │ 0.708152
  994 │ 0.400112
  995 │ 0.675339
  996 │ 0.928244
  997 │ 0.634972
  998 │ 0.879479
  999 │ 0.421488
 1000 │ 0.089676
  956 rows omitted, 3 => 1000×1 DataFrame
  Row │ a         
      │ Float64   
──────┼───────────
    1 │ 0.930302
    2 │ 0.037703
    3 │ 0.526899
    4 │ 0.695352
    5 │ 0.577089
    6 │ 0.76645
    7 │ 0.67396
    8 │ 0.701433
    9 │ 0.392096
   10 │ 0.900775
   11 │ 0.520715
   12 │ 0.150304
   13 │ 0.163764
   14 │ 0.819675
   15 │ 0.447223
   16 │ 0.888266
   17 │ 0.233236
   18 │ 0.428161
   19 │ 0.120211
   20 │ 0.476098
   21 │ 0.14929
   22 │ 0.157515
  ⋮   │     ⋮
  979 │ 0.409008
  980 │ 0.447089
  981 │ 0.934555
  982 │ 0.150629
  983 │ 0.191563
  984 │ 0.520194
  985 │ 0.906902
  986 │ 0.459904
  987 │ 0.881135
  988 │ 0.583629
  989 │ 0.743624
  990 │ 0.507446
  991 │ 0.465958
  992 │ 0.0965513
  993 │ 0.901406
  994 │ 0.983136
  995 │ 0.0541274
  996 │ 0.94198
  997 │ 0.810566
  998 │ 0.835962
  999 │ 0.719289
 1000 │ 0.529618
  956 rows omitted, 1 => 1000×1 DataFrame
  Row │ a         
      │ Float64   
──────┼───────────
    1 │ 0.48894
    2 │ 0.0587311
    3 │ 0.62132
    4 │ 0.670283
    5 │ 0.488473
    6 │ 0.584304
    7 │ 0.159132
    8 │ 0.0462226
    9 │ 0.180555
   10 │ 0.0606411
   11 │ 0.0496764
   12 │ 0.527615
   13 │ 0.479178
   14 │ 0.488616
   15 │ 0.928411
   16 │ 0.533804
   17 │ 0.361465
   18 │ 0.602682
   19 │ 0.363826
   20 │ 0.317636
   21 │ 0.677424
   22 │ 0.833792
  ⋮   │     ⋮
  979 │ 0.682089
  980 │ 0.564962
  981 │ 0.638112
  982 │ 0.702927
  983 │ 0.929532
  984 │ 0.410278
  985 │ 0.256351
  986 │ 0.664375
  987 │ 0.493929
  988 │ 0.219025
  989 │ 0.278294
  990 │ 0.383522
  991 │ 0.3111
  992 │ 0.427193
  993 │ 0.424824
  994 │ 0.525354
  995 │ 0.438547
  996 │ 0.572432
  997 │ 0.976791
  998 │ 0.653697
  999 │ 0.560274
 1000 │ 0.717534
  956 rows omitted…),)

Shouldn’t the display of (d,) use something more concise as it does for d?

It is unrelated to DataFrames.jl I think, e.g. see that here is a different display used:

julia> x = rand(4,4)
4×4 Matrix{Float64}:
 0.603365  0.10545   0.0311994  0.185977
 0.160353  0.563513  0.966015   0.533874
 0.518269  0.53229   0.766736   0.873949
 0.818487  0.922752  0.469565   0.301435

julia> d = Dict(i => x for i in 1:2)
Dict{Int64, Matrix{Float64}} with 2 entries:
  2 => [0.603365 0.10545 0.0311994 0.185977; 0.160353 0.563513 0.966015 0.533874; 0.518269 0.53229 0.766736 0.873949; 0.818487 0.922752 0.469565 0.301435]
  1 => [0.603365 0.10545 0.0311994 0.185977; 0.160353 0.563513 0.966015 0.533874; 0.518269 0.53229 0.766736 0.873949; 0.818487 0.922752 0.469565 0.301435]

julia> (d,)
(Dict(2 => [0.60336529705611 0.10545028415773139 0.031199369698845514 0.18597745975724744; 0.16035269020209297 0.5635134840484995 0.9660151929086402 0.5338739339215327; 0.5182690569876465 0.5322899568813855 0.7667364125913148 0.8739488460950722; 0.8184870098606191 0.9227520718115758 0.4695646804545037 0.301434541603137], 1 => [0.60336529705611 0.10545028415773139 0.031199369698845514 0.18597745975724744; 0.16035269020209297 0.5635134840484995 0.9660151929086402 0.5338739339215327; 0.5182690569876465 0.5322899568813855 0.7667364125913148 0.8739488460950722; 0.8184870098606191 0.9227520718115758 0.4695646804545037 0.301434541603137]),)

It seems that when displaying a tuple a non-compact version is printed.

1 Like

I think there’s an issue with how containers are abbreviated… For example

fill(rand(1000), 1000)

in a small terminal window will show many “screens” of text (I thought that was something Julia doesn’t do!). If I show the same in a large window, it looks kind of like it’s abbreviated to fit the window size, but wrong, so it’s still more than one “screen”.