5 Jupyter Extensions to Improve your Productivity | by Cornellius Yudha Wijaya | Towards Data Science

Jupyter Notebook is a popular IDE for many data experts for analyzing data and developing machine learning models because of its useability and utility. The Notebook is already a beginner-friendly IDE to use and could be extended even more to improve your data activity productivity with a bit of tweak.
For the above reasons, I want to outline my five Jupyter extensions to improve your productivity in this article. Let's get into it!
Have you been in a situation where your Jupyter Notebook became slow or crashed because of memory issues? This case often happens when we explore big data or heavy modelling computation processes that take a huge chunk of memory.
To control the memory issues, we could use the jupyter-resource-usage extensions to display the memory usage in our Notebook. This extension work is simple; all the resources in your current notebook servers and children would be displayed on the top right side. Let's try to install the extensions.
pip install jupyter-resource-usage
When you have finished installing the package, try to restart the Jupyter and access your Jupyter Notebook. The memory display should be available in your Notebook now.
If you want to limit the allocated resources, you could control them using various methods explained here.
Every time you work in a new environment or develop a new project, you must import all the required package. It is not a dealbreaker, but sometimes it isn't enjoyable to import all the packages all over again. This is why pyforest were developed.
The pyforest extensions is an auto-import popular python package from Bamboolib developer. This extension transform your workflow to automatically importing the so popular packages such as pandas, numpy, sklearnAnd many more. You can check the list here.
Let's try to install the pyforest extension.
pip install --upgrade pyforestpython -m pyforest install_extensions
After you have finished installing the package, you should restart the Jupyter for pyforest auto-import to take place. Let's see if the extension has taken place or not.
As you can see from the above image, I did not import any seaborn or pandas package, but I could automatically use it in my Jupyter Notebook. The pyforest extension would automatically import this package with the popular abbreviation (seaborn as sns, pandas as pd, etc.).
You don't need to worry about memory allocation because pyforest did not import all the packages initially but only the required package when you execute the code that uses the particular package.
Like the name imply, jupyter-themes is a Jupyter Notebook extension to change the theme. This extension also changes our plotting, markdown, pandas dataframe, and many more. So, the themes change is not limited only to the Jupyter Notebook background.
Let's try to install the jupyter-themes. You could use the following code to install the package.
pip install jupyterthemes
After installation, you could access the jupyter-themes via CLI to change the Jupyter Notebook theme. First, let's see what themes are available using the following code in our command prompt.
jt -l
There are nine themes available in default for us to select. Let's try one of the themes, let's say the 'chesterish'.
jt -t chesterish
To see the changes in your Jupyter Notebook, you need to restart the server. After that, you will see your Notebook similar to the below image.
If you want to reset the theme into the default one, you could reset it by using the following code.
jt -r
You could still do many things with jupyter-theme, such as controlling the colour, cell width, hiding the specific toolbar, and many more. You could read all the commands on their page.
The jupyter-notify extension is a Jupyter Notebook extension to notify us when our cell has done running. This extension is useful when running a time-consuming modelling process or cleaning activity and you want to do something else while waiting.
First, we need to install the package by using the following code.
pip install jupyternotify
After installing this package, you need to load the notification in your Jupyter Notebook by running the following magic command code.
%load_ext jupyternotify
The setup is ready; let's try to run the Notebook and get notified. We would use the following code, for example.
%%notifyimport timetime.sleep(2)print('Finish Trying Notifiy')
Using the magic command %%notify in the cell, we would get notified similar to the image above when we had finished running the code. If you want to have a specific message in your notification, you could add the message just like the example below.
%%notify -m "Execution done"time.sleep(2)print('Finish Trying Notifiy')
Adding the -m parameter after the magic command would allow you to edit the message. It would be helpful if you need to be notified of particular messages.
The watermark extension is a magic command that allowed us to print the hardware, version, time, and much more information via the Jupyter Notebook environment. It is helpful if we need the information quickly during our exploration.
To install the package, we need to use the following code.
pip install watermark
After installing the package, we could load the extension in our Notebook by running the following code.
%load_ext watermark
Let's try the extension in our Jupyter Notebook. First, we could run the following code to get our hardware information.
%watermark
In default, the magic command %watermark would give us the hardware information. We could acquire much information using watermark, for example, the package version we have imported in our Jupyter Notebook environment.
%watermark --iversion
If you want to know all the available commands to use, you could visit the main page.
Jupyter Notebook is one of the most used IDE for data experts, and to increase the productivity using this IDE, I have outlined my five extensions; they are:
jupyter-resource-usagepyforestjupyter-themesjupyter-notifywatermark
jupyter-resource-usage
pyforest
jupyter-themes
jupyter-notify
watermark
I hope it helps!
Visit me on my LinkedIn or Twitter.
If you enjoy my content and want to get more in-depth knowledge regarding data or just daily life as a Data Scientist, please consider subscribing to my newsletter here.
If you are not subscribed as a Medium Member, please consider subscribing through my referral.