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

show all columns at HTML in Jupyter notebook #2293

Closed
marketneutral opened this issue Jun 16, 2020 · 1 comment
Closed

show all columns at HTML in Jupyter notebook #2293

marketneutral opened this issue Jun 16, 2020 · 1 comment

Comments

@marketneutral
Copy link

I am working in Jupyter/IJulia. I would like to be able to show the full number of columns rendered in HTML.

I am trying

show(MIME("text/html"), df, allcols=true)

which throws

MethodError: no method matching show(::MIME{Symbol("text/html")}, ::DataFrame; allcols=true)

Stacktrace:
 [1] top-level scope at In[341]:1

I can render the dataframe as text with show(df, allcols=true), but what I need/want is HTML.

A workaround is to set ENV["COLUMNS"] to something very large and then I can see all columns, but this seems like a hacky workaround.

Is there a way to render the full dataframe in HTML just using show? Thank you.

@bkamins
Copy link
Member

bkamins commented Jun 16, 2020

If you want it rendered in Jupyter Notebook, then setting ENV["COLUMNS"] is the standard way to do it. The reason is that Jupyter Notebook not only renders HTML but also LaTeX and due to this it has a special handling of IO (in particular it uses ENV["COLUMNS"] internally to determine output width).

However, if you need a HTML output sent to an IO to which a variable called e.g. io points then just do:

show(io, MIME("text/html"), df)

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

No branches or pull requests

2 participants