# Problem with package TableView / Julia usage

**URL:** <https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369>\
**Category:** New to Julia\
**Created:** [May 12, 2020, 9:27pm UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369 "2020-05-12T21:27:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![marco\_zanon](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@marco\_zanon](https://discourse.julialang.org/u/marco_zanon)\
**Post date:** [May 12, 2020, 9:27pm UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/1 "2020-05-12T21:27:50Z")

</div>

First of all I would like to apologize if my question is too elementary. Although I have some experience with MS Excel VBA I am still a beginner at general use programming languages. Also, I would like to apologize for any misspelling, since English is not my first language.

Since I needed to do some rather complex string wrangles I decided to try Python last year so I would have more flexibility to code than in Excel and I really liked it. One problem arouse though, when I was facing a fuzzy logic problem for string matching in very large texts (and with loops). Pyhton was not handling the calculations well and was taking literally hours do finish my scripts.

So I decided to try Julia, and found the performance was indeed better, so I adopted the language as my working tool. The problem I have is that I like to work with dataframes which in my opinion is what better emulates the nice data visualization of Excel while allowing the flexibility of general programming languages.

Pandas was great and I could visualize data very well. DataFrames.jl is good, but the fact that it keeps omitting columns when displaying Data Frames kind of annoys me. For some of my dataframes even setting the Notebook ENV[“COLUMNS”] for huge values wont show all columns. Of course I could do show(df allcols = true), but that renders a really ugly and somewhat confusing vision of the DataFrame.

So searching the net I read about this Julia package (TableView.jl) that could render Julia data in a good way. After facing all kind of problems installing the package I finally was able to install it without warnings (actually I was having problem installing one of its dependencies, WebIO, which I think that I solved - or at least didnt throw me any more warnings).

But the problem is I just cannot use TableView.jl with dataframes. When I try

```julia
using DataFrames, TableView

A = rand(30, 20)
d = DataFrame(A)
showtable(d)

```

it throws me the following exception:

```julia
> MethodError: no method matching eachcolumn(::Tables.ColumnsRow{NamedTuple{(:x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13, :x14, :x15, :x16, :x17, :x18, :x19, :x20),NTuple{20,Array{Float64,1}}}})
> Closest candidates are:
> eachcolumn(!Matched::Union{Function, Type}, !Matched::Tables.Schema{names,nothing}, !Matched::Any) where names at C:\Users\marco\.julia\packages\Tables\okt7x\src\utils.jl:109
> eachcolumn(!Matched::Union{Function, Type}, !Matched::Tables.Schema{names,types}, !Matched::Any) where {names, types} at C:\Users\marco\.julia\packages\Tables\okt7x\src\utils.jl:66
> 
> Stacktrace:
> [1] table2json(::Tables.RowIterator{NamedTuple{(:x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13, :x14, :x15, :x16, :x17, :x18, :x19, :x20),NTuple{20,Array{Float64,1}}}}, ::NTuple{20,Symbol}, ::NTuple{20,DataType}; requested::Nothing) at C:\Users\marco\.julia\packages\TableView\kqtYa\src\TableView.jl:210
> [2] table2json at C:\Users\marco\.julia\packages\TableView\kqtYa\src\TableView.jl:204 [inlined]
> [3] _showtable_sync!(::WebIO.Scope, ::NTuple{20,Symbol}, ::NTuple{20,DataType}, ::Tables.RowIterator{NamedTuple{(:x1, :x2, :x3, :x4, :x5, :x6, :x7, :x8, :x9, :x10, :x11, :x12, :x13, :x14, :x15, :x16, :x17, :x18, :x19, :x20),NTuple{20,Array{Float64,1}}}}, ::Array{NamedTuple{(:headerName, :editable, :headerTooltip, :field, :sortable, :resizable, :type, :filter),Tuple{Symbol,Bool,DataType,Symbol,Bool,Bool,String,String}},1}, ::Int64, ::Bool, ::String, ::WebIO.JSString) at C:\Users\marco\.julia\packages\TableView\kqtYa\src\TableView.jl:145
> [4] showtable(::DataFrame; dark::Bool, height::Symbol, width::String, cell_changed::Nothing) at C:\Users\marco\.julia\packages\TableView\kqtYa\src\TableView.jl:139
> [5] showtable(::DataFrame) at C:\Users\marco\.julia\packages\TableView\kqtYa\src\TableView.jl:62
> [6] top-level scope at In[11]:1

```

I have tried to uninstall and reinstall both TableView and WebIO (Pkg.rm(“TableView”) Pkg.add(“TableView”), the same for “WebIO”) and I also tried to rebuid them (Pkg.build(“TableView”), Pkg.build(“WebIO”)) but to no avail.

I would also like to mention how straightforward were all my Python installations using conda install or pip install. Also, differences in documentation, TableView documentation, for instance, is rather shallow. Altough I understand that right now Python is a much more mature language (and Julia will catch up eventually) it might turn Julia in a somewhat intimidating language, especially for begginers like myself.

For what is worth it my editor is Jupyter Notebook version 6.0.3 (installed with Anaconda), my Julia kernel is version 1.4.0 and my OS is Windows 10.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![js135005](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/js135005/32/8219_2.png) [@js135005](https://discourse.julialang.org/u/js135005)\
**Post date:** [May 12, 2020, 10:26pm UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/2 "2020-05-12T22:26:55Z")

</div>

You might want to look at PrettyTables.jl. It handles most tabular datastructures including DataFrames directly and can output LaTeX and html as well as straightforward printing. However it isn’t optimized for interactive browsing.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [May 13, 2020, 12:42am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/3 "2020-05-13T00:42:07Z")

</div>

OP, I’m sorry to hear about your problems. Its frustrating when getting set up isn’t seamless, especially when you are used to something as battle-tested as excel.

I can replicate the error on Ubuntu with Julia 1.4.0. I installed IJulia and opened up a jupyter notebook with `notebook()`. Then I tried to use TableView like you did and got an error about `WebIO not detected`.

The error had a link to the troubleshooting page [here](https://juliagizmos.github.io/WebIO.jl/latest/troubleshooting/not-detected/). I ran

```julia
using WebIO
WebIO.install_jupyter_nbextension()

```

Then I closed out of everything and re-loaded the notebook. When I did `showtable(df)` it opened up an ag-grid pane beneath my cell, but didn’t fill it with anything. I didn’t get the error you had.

I then closed out of everything and did `] build`. But I have the same behavior as above.

There is also [BrowseTables.jl](https://github.com/tpapp/BrowseTables.jl). It has fewer bells and whistles than TableView but is definitely faster. The command `HTMLTable(df)` will render a table the way you want.

EDIT: BrowseTables is a bit slow on my session with a 1000 x 200 data frame. So you might run into trouble even with this.

---

<div class="post-metadata">

**Author:** ![marco\_zanon](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@marco\_zanon](https://discourse.julialang.org/u/marco_zanon)\
**Post date:** [May 13, 2020, 2:36am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/5 "2020-05-13T02:36:07Z")

</div>

@js135005

I apreciate your response, I already installed the package and tried with my above mentioned df. I wasn’t able to display the entire df on Notebook, but I can see that package documentation is much more informative than what I found in TableView. Later on I will read it and definetely give it a try with my more complex dataframes.

Thank you!

---

<div class="post-metadata">

**Author:** ![marco\_zanon](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@marco\_zanon](https://discourse.julialang.org/u/marco_zanon)\
**Post date:** [May 13, 2020, 2:48am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/6 "2020-05-13T02:48:51Z")

</div>

@pdeffebach

I apreciate your response.

Regarding WebIO installation, besides what you did, I also ran “pip install jupyter\_contrib\_nbextensions” in Anaconda prompt, something that I found in Internet looking for solutions, but I don´t really know how much it helped. Wonder if it has something to do with the fact that we got different outputs using TableView…

Regarding BrowseTables.jl, I already installed it and used in my above mentioned df, and it worked wonderfully right away. Thank you!

I will try it in my more complex daraframes later.

Nonethless, I would really like to know what went wrong with my TableVIew installation, in case I face similar problem in the future. So if anyone else has any hints, it will be welcomed.

Regards.

---

<div class="post-metadata">

**Author:** ![brianguenter](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brianguenter/32/29519_2.png) [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Post date:** [May 21, 2020, 10:14pm UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/7 "2020-05-21T22:14:25Z")

</div>

I had the same problem using TableView with DataFrames, same error message.

Julia Version 1.4.1  
Commit 381693d3df\* (2020-04-14 17:20 UTC)  
Platform Info:  
OS: Linux (x86\_64-pc-linux-gnu)  
CPU: AMD EPYC 7702P 64-Core Processor  
WORD\_SIZE: 64  
LIBM: libopenlibm  
LLVM: libLLVM-8.0.1 (ORCJIT, znver1)  
Environment:  
JULIA\_NUM\_THREADS = 64  
JULIA\_EDITOR = “/usr/share/code/code”

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [May 22, 2020, 7:39am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/8 "2020-05-22T07:39:24Z")

</div>

`ENV["COLUMNS"]` seems not to work correctly.

```julia
using DataFrames
df = DataFrame()
for i=1:100
    df[!, Symbol(i)] = 1:10
end
ENV["COLUMNS"]="20"
df

```

Shows only 3 columns (not 20) for me when executed in Jupyter Lab (Jupyter Datascience Notebook Docker container).  
Setting COLUMNS to very high numbers shows all columns.

Edit: Issue created:

> <https://github.com/JuliaData/DataFrames.jl/issues/2266>
>
> \`ENV\["COLUMNS"\]\` seems not to work correctly:
> 
> \`\`\`
> using DataFrames
> df = Dat…aFrame()
> for i=1:100
> df\[!, Symbol(i)\] = 1:10
> end
> ENV\["COLUMNS"\]="20"
> df
> \`\`\`
> This shows only 3 columns (not 20) for me when executed in Jupyter Lab.
> Setting COLUMNS to very high numbers shows all columns.
> 
> Environment:
> Jupyter Datascience Notebook Docker container, Julia 1.4.1, DataFrames.jl version 0.21 and master.
> I got the same issue for Jupyter Lab in a Windows Conda environment.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 22, 2020, 8:15am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/9 "2020-05-22T08:15:34Z")

</div>

I think `ENV["COLUMNS"]` works differently to what you expect - it basically set the horizontal space available to show columns (not sure in which metric…), and then showing the DataFrame will display as many columns as will fit in that available horizontal space, which will depend on how wide each column is.

Compare

```julia
df = DataFrame(rand(10, 1000))

```

with

```julia
df2 = DataFrame(rand(1:5, 10, 1000))

```

and you should see that more columns of `df2` are displayed than of `df` for any value of `ENV["COLUMNS"]`. So you can’t interpret the number you put into the environment variable as the number of columns displayed.

---

<div class="post-metadata">

**Author:** ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)\
**Post date:** [May 22, 2020, 8:21am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/10 "2020-05-22T08:21:30Z")

</div>

Thanks for pointing this out!  
Now I can even see this in the documentation, missed it before.

---

<div class="post-metadata">

**Author:** ![hhaensel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hhaensel/32/1207_2.png) [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Post date:** [May 25, 2020, 4:18pm UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/11 "2020-05-25T16:18:09Z")

</div>

The [issue](https://github.com/JuliaComputing/TableView.jl/issues/38) has meanwhile been corrected …

Currently you have to do  
`]add TableView#master`

to use TableView for dataframes

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [May 25, 2020, 4:27pm UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/12 "2020-05-25T16:27:28Z")

</div>

That fix is in the latest release.

---

<div class="post-metadata">

**Author:** ![hhaensel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hhaensel/32/1207_2.png) [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Post date:** [May 26, 2020, 7:28am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/13 "2020-05-26T07:28:46Z")

</div>

Thanks for clarifying, my version of TableView was kept at 0.4.1 due to parallel installation of WGLMakie.

@marco_zanon  
Maybe you have a similar problem. So you may check your version of TableView by  
`]st TableView` and update if it is not 0.6.0.

If updating leaves you with a lower version you could do

`]add TableView@0.6.0` to find out, where the problem is.

---

<div class="post-metadata">

**Author:** ![marco\_zanon](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@marco\_zanon](https://discourse.julialang.org/u/marco_zanon)\
**Post date:** [May 27, 2020, 1:49am UTC](https://discourse.julialang.org/t/problem-with-package-tableview-julia-usage/39369/14 "2020-05-27T01:49:44Z")

</div>

@hhaensel  
Now it works perfectly. Thank you for pointing this out.
