- 1. Collapse heading extension / code folding extension
- 2. Use Jupyter Themes
- 3. Other interesting tools
- 4. Other tips
The jupyter contrib nbextensions Python package contains a code-folding extension that can be enabled within the notebook.
To install using command line:
pip install jupyter_contrib_nbextensions
To make life easier in managing them, I’d also recommend the jupyter nbextensions configurator package. This provides an extra tab in your Notebook interface from where you can easily (de)activate all installed extensions.
pip install jupyter_nbextensions_configurator
Then the package will provide a UI that you can open in your browser.
If your dashboard is at
then you’ll find the configurator UI page at
It will also be opened from the tab on your dashboard
Now, go to “Nbextensions” tab, and enable the functions you need:
Limit Output: 1000
Table of Contents
Split Cells Notebook
It’s nice to have all those foldings inside our notebooks when we are doing DS work and presenting this to others. However, when we share the notebooks to others, especially those who don’t have the same jupyter environment setup like us, how can we make sure they can see the same nice formatted report?
Well, run the following magic command and you will see an html exported with the same “collapsible heading” format!
jupyter nbconvert --to html_ch some_notebook.ipynb
jupyter nbconvert supports many other formats e.g slides, latex, pandoc, please refer to their documentation
Got tired with the default notebook style? You can change to other themes and different plotting styles!
pip install jupyterthemes
# selecting a particular theme
jt -t <name of the theme>
# reverting to original Theme
You can have a look of how each of the theme look like here
# only required if you have not added conda-forge to your channels yet
#Note that http urls will not be displayed. Only https are allowed inside the Iframe
jupyter notebook --ip='*' --NotebookApp.token='' --NotebookApp.password='' --port=51111 --no-browser
Edit -> Replace -> Use regex -> \t -> replace with 4 spaces