TableView works great for browsing data as a spreadsheet!

Just wanted to share some appreciation for https://github.com/JuliaComputing/TableView.jl as I’ve observed that many people are not aware of its existence. You can browse a spreadsheet of data easily, and it works with Jupyter and Atom. It’s a good feature which I think people expect from “professional” IDEs, and Julia does have it.

6 Likes

Agreed, just started using it in earnest today coincidentally. I did notice however that in Juno I couldn’t display tables with more than about 10,000 rows and 20 columns - I found it hard to find an exact limit but it seems after a certain total size (rows*columns) it only displays column names, with the rest of the window remaining blank. Can you reproduce?

I was surprised by this as I seemed to remember @pfitzseb saying at some point that TableView is lazy, so should be able to deal with very large tables.

1 Like

This worked fine for me and I was able to browse the table smoothly.

julia> using DataFrames, TableView

julia> A = rand(50000, 30)
50000×30 Array{Float64,2}:
 0.299217  0.484993   0.68072    0.704397  0.971115  0.535767  0.686668   0.798531   …  0.534831  0.0931398  0.0434908  0.865825   0.917773  0.924434  0.562176   0.997514
 0.857924  0.334256   0.805819   0.651175  0.782703  0.757511  0.14899    0.0608908     0.880466  0.202476   0.831109   0.800233   0.228575  0.664497  0.379918   0.731786
 0.939592  0.0574469  0.381392   0.742953  0.183711  0.325798  0.428495   0.647087      0.348751  0.11106    0.915108   0.0717139  0.885568  0.80765   0.239606   0.348155
 0.095512  0.167257   0.789775   0.869192  0.933765  0.101357  0.772833   0.617562      0.942369  0.339468   0.12918    0.448479   0.195099  0.440268  0.305952   0.261834
 ⋮                                                   ⋮                               ⋱                                  ⋮                                                 
 0.654192  0.0181786  0.457457   0.723033  0.212456  0.344559  0.876255   0.491564      0.385133  0.780898   0.6759     0.190554   0.776361  0.558435  0.423609   0.288569
 0.592176  0.311358   0.945982   0.868463  0.358914  0.53993   0.44921    0.405513      0.816898  0.271402   0.131602   0.37961    0.941219  0.840926  0.410215   0.199085
 0.249939  0.294833   0.0802551  0.192639  0.93013   0.616362  0.30389    0.74886       0.848961  0.0663378  0.176921   0.429443   0.518527  0.244858  0.349641   0.420567
 0.167823  0.29422    0.355367   0.921845  0.172252  0.560732  0.0655776  0.453279      0.913732  0.652379   0.221709   0.224207   0.450821  0.733938  0.0431778  0.434437

julia> d = DataFrame(A)
50000×30 DataFrame. Omitted printing of 16 columns
│ Row   │ x1       │ x2       │ x3        │ x4       │ x5       │ x6       │ x7        │ x8        │ x9       │ x10      │ x11      │ x12      │ x13      │ x14      │
│       │ Float64  │ Float64  │ Float64   │ Float64  │ Float64  │ Float64  │ Float64   │ Float64   │ Float64  │ Float64  │ Float64  │ Float64  │ Float64  │ Float64  │
├───────┼──────────┼──────────┼───────────┼──────────┼──────────┼──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────┤
│ 1     │ 0.299217 │ 0.484993 │ 0.68072   │ 0.704397 │ 0.971115 │ 0.535767 │ 0.686668  │ 0.798531  │ 0.919464 │ 0.649542 │ 0.54387  │ 0.701063 │ 0.311973 │ 0.254596 │
│ 2     │ 0.857924 │ 0.334256 │ 0.805819  │ 0.651175 │ 0.782703 │ 0.757511 │ 0.14899   │ 0.0608908 │ 0.293237 │ 0.661245 │ 0.562023 │ 0.945993 │ 0.737524 │ 0.666416 │
⋮
│ 49998 │ 0.592176 │ 0.311358 │ 0.945982  │ 0.868463 │ 0.358914 │ 0.53993  │ 0.44921   │ 0.405513  │ 0.816907 │ 0.971051 │ 0.855345 │ 0.753981 │ 0.35005  │ 0.691779 │
│ 49999 │ 0.249939 │ 0.294833 │ 0.0802551 │ 0.192639 │ 0.93013  │ 0.616362 │ 0.30389   │ 0.74886   │ 0.885027 │ 0.386624 │ 0.98086  │ 0.738742 │ 0.601959 │ 0.830144 │
│ 50000 │ 0.167823 │ 0.29422  │ 0.355367  │ 0.921845 │ 0.172252 │ 0.560732 │ 0.0655776 │ 0.453279  │ 0.666126 │ 0.796599 │ 0.505828 │ 0.389986 │ 0.250585 │ 0.606743 │

julia> showtable(d) 

Hm, very odd, hadn’t tried the REPL before and am getting:

┌ Warning: Accessing `scope.id` is deprecated, use `scopeid(scope)` instead.
│   caller = ip:0x0
└ @ Core :-1
WebIO.Scope(WebIO.Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[], Dict{Symbol,Any}(:id => "grid-fca39320",:className => "ag-theme-balham",:style => Dict("height" => "500px","width" => "100%"))), Dict{String,Tuple{Observables.AbstractObservable,Union{Nothing, Bool}}}("requestedrows" => (Observable{JSON.Writer.JSONText} with 1 listeners. Value:

plus a whole wall of text (some JSON output I think)

I did it in Juno, not the REPL. I don’t see any table in the REPL.

Aaah, sorry, I sort of assumed that this was REPL code for whatever reason - yes in Juno a 50,000x30 DataFrame with random floats works, so must be something to do with the particular data set I’m displaying.

I was just playing around with getting it in REPL. It’s pretty easy:

using DataFrames, TableView, Blink

function my_show(df)
    w =Blink.Window()
    body!(w, showtable(df))
end

The latency is okay! Its hangs a bit for a 10_000 x 100 dataset, but it’s not horrible. It’s not Stata’s QT browse command, but its better than R Studio!

4 Likes