Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see a whole DataFrame in Jupyter in Julia

I use Jupyter to develop Julia code. How can I show a whole DataFrame with, say, 200 rows. I tried head(myDataframe, 200) but only the first 30 rows are shown. If I do it without the head I get 30 rows again.

like image 968
Ferenc Avatar asked Sep 10 '15 18:09

Ferenc


2 Answers

The output of showall looks nasty in a HTML capable display like Jupyter or Weave, so instead you can use the LINES environment variable to increase the displayed row count.

using DataFrames

df = DataFrame(A = rand(Int, 100), B = rand(Int, 100))

withenv("LINES" => 20) do
    display(df)
end

There is also a COLUMNS var, see the displaysize function help.

AFAICT to disable the limit altogether you need to change the display context which gets a bit messy and is just generally inadvisable, but here it is anyway

io = IOBuffer()
ioctx = IOContext(io, :limit => false)
show(ioctx, MIME("text/html"), df)
HTML(String(take!(io)))
like image 53
Richard Palethorpe Avatar answered Oct 03 '22 08:10

Richard Palethorpe


I've tested showall in JuliaBox and it works fine.

using DataFrames
df = DataFrame(A=1:200, B=rand(200))
Out[]:only showing the first 30 rows

showall(df)
Out[]:showing all rows 
like image 36
Gnimuc Avatar answered Oct 03 '22 08:10

Gnimuc