Jupyter notebook is by far my all time favorite tool. It is the go-to tool for data exploration for any data scientist or data analyst out there. If you are new to the data space and don’t yet know what I am talking about, check out this YouTube video by
Jupyter lets us employ extensions to make the environment more suitable for any personality out there. In this post, I am sharing with you my personal Jupyter personalization tips and tricks.
Table of Contents
- Shell Commands
- Jupyter Themes
Shell is a way to interact with the computer through text commands. Of all the shell variants, bash (Born Again Shell) is the most popular and is the default shell for modern implementations of Unix.
When you are working in
In addition to simply running shell commands, we can pass values between python and shell like this:
curr_directory = !pwd files_in_dir = !ls
I am a big fan of a dark theme in my IDE or notebook editors. I was therefore ecstatic when I found out that you could change the look of Jupyter.
pip install jupyterthemes
List and Chose a Theme
When you have successfully installed
Jupiter has a decent size list of extensions that will help make you Jupiter-life simpler.
In order to use these extensions, we will need to install them using the following pip and jupyter commands:
pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install
As you can see from the screenshot above, my favorite extensions are as follows:
When you are using markdown headings in your notebook, this extension lets you collapse the section underneath a given header. One of the most valuable extensions I use as it makes the coding environment cleaner.
Hinterland enables code autocompletion as you type in your notebook, as opposed to enabling it with the tab key which Jupyter defaults to. I have found that it was quite annoying in the beginning and that I had to play around with some of the settings.
Do you find yourself typing in the same import statements for every notebook? Import Numpy, pandas, seaborn, matplotlib, and so on… This extension lets you input predefined snippets of code into your notebook with only a couple of mouse clicks.
Split Cells Notebook
Split cells notebook allows you to split a cell into multiple columns. There are times when I’ve wanted to have two cells next to each other horizontally, and this allows you to do exactly that.
Table of Contents
This extension adds a section to the left of your notebook which keeps track of all your markdown headings and lets you jump back and forth between them. It also highlights the section that currently has running cells. This is one of the most useful extensions I’ve found. By far my favorite.
How many times have you written print(variable) simply because you wanted to double check the value of a variable? The variable inspector collects all your defined variables and displays them in a neat little floating window. The window is draggable, resizable, and collapsible.
That concludes this blog post on how I have my Jupyter environment set up. I hope you found it helpful and that this will make your life a little bit easier the next time you dive into a notebook.
Let me know if you have any preferences that might be different from mine. Who knows, maybe I will find them useful as well.