Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython Notebook output cell is truncating contents of my list

I have a long list (about 4000 items) whose content is suppressed when I try to display it in an ipython notebook output cell. Maybe two-thirds is shown, but the end has a "...]", rather than all the contents of the list. How do I get ipython notebook to display the whole list instead of a cutoff version?

like image 869
user3006135 Avatar asked Apr 30 '14 13:04

user3006135


People also ask

How do you show full output in Jupyter notebook?

To show the full data without any hiding, you can use pd. set_option('display. max_rows', 500) and pd.

What does %% capture do?

Capturing Output With %%capture IPython has a cell magic, %%capture , which captures the stdout/stderr of a cell. With this magic you can discard these streams or store them in a variable. By default, %%capture discards these streams. This is a simple way to suppress unwanted output.

How do you not show the output of a cell in Jupyter notebook?

Hide cell inputs If you add the tag hide-input to a cell, then Jupyter Book will hide the cell but display the outputs.


3 Answers

pd.options.display.max_rows = 4000

worked for me

See : http://pandas.pydata.org/pandas-docs/stable/options.html

like image 155
Jelmer Avatar answered Oct 18 '22 02:10

Jelmer


I know its a pretty old thread, but still wanted to post my answer in the hope it helps someone. You can change the number of max_seq_items shown by configuring the pandas options as follows:

pd.options.display.max_seq_items = 2000
like image 33
impiyush Avatar answered Oct 18 '22 03:10

impiyush


This should work:

print(str(mylist))

Simple!

like image 16
Noah Avatar answered Oct 18 '22 03:10

Noah