Display a full list

I’d like to display a list in the output. The problem is that when the list reaches a certain size, JupyterLab truncates it.

Example:

emmaWords = gutenberg.words('austen-emma.txt')

emmaWords[ : 153]

outputs

[‘[’, ‘Emma’, ‘by’, ‘Jane’, ‘Austen’, ‘1816’, ‘]’, …]

but at a smaller size outputs the desired sublist:

emmaWords = gutenberg.words('austen-emma.txt')

emmaWords[ : 133]

[‘[’, ‘Emma’, ‘by’, ‘Jane’, ‘Austen’, ‘1816’, ‘]’, ‘VOLUME’, ‘I’, ‘CHAPTER’, ‘I’, ‘Emma’, ‘Woodhouse’, ‘,’, ‘handsome’, ‘,’, ‘clever’, ‘,’, ‘and’, ‘rich’, ‘,’, ‘with’, ‘a’, ‘comfortable’, ‘home’, ‘and’, ‘happy’, ‘disposition’, ‘,’, ‘seemed’, ‘to’, ‘unite’, ‘some’, ‘of’, ‘the’, ‘best’, ‘blessings’, ‘of’, ‘existence’, ‘;’, ‘and’, ‘had’, ‘lived’, ‘nearly’, ‘twenty’, ‘-’, ‘one’, ‘years’, ‘in’, ‘the’, ‘world’, ‘with’, ‘very’, ‘little’, ‘to’, ‘distress’, ‘or’, ‘vex’, ‘her’, ‘.’, ‘She’, ‘was’, ‘the’, ‘youngest’, ‘of’, ‘the’, ‘two’, ‘daughters’, ‘of’, ‘a’, ‘most’, ‘affectionate’, ‘,’, ‘indulgent’, ‘father’, ‘;’, ‘and’, ‘had’, ‘,’, ‘in’, ‘consequence’, ‘of’, ‘her’, ‘sister’, “'”, ‘s’, ‘marriage’, ‘,’, ‘been’, ‘mistress’, ‘of’, ‘his’, ‘house’, ‘from’, ‘a’, ‘very’, ‘early’, ‘period’, ‘.’, ‘Her’, ‘mother’, ‘had’, ‘died’, ‘too’, ‘long’, ‘ago’, ‘for’, ‘her’, ‘to’, ‘have’, ‘more’, ‘than’, ‘an’, ‘indistinct’, ‘remembrance’, ‘of’, ‘her’, ‘caresses’, ‘;’, ‘and’, ‘her’, ‘place’, ‘had’, ‘been’, ‘supplied’, ‘by’, ‘an’, ‘excellent’, ‘woman’, ‘as’, ‘governess’, ‘,’, ‘who’]

How do I increase the size of the output list either at the cell level or globally?

Details:

  • jupyterlab=1.2.4
  • xeus-python=0.6.8

Upgrading JupyterLab is not an option because of dependencies.

Nevermind, I realized the problem is that NLTK is not returning a list, but a nltk.util.LazySubsequence, so the problem is there, not with Jupyter.

1 Like

Out of interest, can you share which dependencies are holding you off? Is it something from Project Jupyter we should upgrade, or is it a third-party?

Just trying to understand how to help users migrate to newer versions (especially today because Python 3.6 is EOL since yesterday and will no longer receive security upgrades and JupyterLab 1.x was developed against 3.6).

Sure thing but probably not that interesting - I developed an extension that I use for teaching. So currently I’m avoiding conflicts with the extension, but I hope to upgrade it next year: