IPython Notebook output cell is truncating contents of my list

后端 未结 9 1652
轮回少年
轮回少年 2020-12-01 11:29

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

9条回答
  •  感情败类
    2020-12-01 12:17

    Here's a way to display the whole list in the IPython output cell that doesn't require Pandas:

    from IPython.display import HTML
    x = range(4000)
    HTML('
    '.join(str(y) for y in x))

    It is also pretty easy to add additional HTML elements and get a more elaborate display. Clicking to the left of the output cell will now shrink the contents and add a local scroll bar.

提交回复
热议问题