10 Compelling Reasons you Should Use JupyterLab for Data Science Coding

Aniruddha Bhandari Last Updated : 28 Jun, 2023
6 min read

Overview

  • JupyterLab is a brilliant coding environment to perform data science tasks
  • These 10 reasons will convince to switch to JupyterLab from Jupyter Notebooks for data science coding

Cozying up with Jupyter? Time to move to JupyterLab!

Ask Python programmers which coding environment they prefer, the answer is invariably Jupyter notebooks. Honestly, Jupyter is synonymous when talking about data science. We take it for granted that this is the best Python coding environment out there. Even I’ve fallen for this line of thought!

Let me share with you what one of my data science mentors told me a while back – “It’s time to get over Jupyter notebooks, there is something better out there”. I was taken aback. Better than Jupyter notebooks? I took my initial steps in data science with Jupyter holding my hand, how can I move on?

And what’s the alternate coding environment anyway? Step up, JupyterLab. Jupyter as we know it has transformed into JupyterLab with much-needed upgrades along with all the good old features. And trust me, you will love working won data science tasks in JupyterLab.

JupyterLab

So in this article, I am going to give you 10 reasons that will make you want to migrate to JupyterLab straight away.

Note: If you are new to the data science industry or have never used Jupyter before, I recommend going through this article which is a great introduction to Jupyter notebooks. You should also check out this nifty free course on data science hacks, tips, and tricks.

Reason #1 – Everything under one roof

Did you know that the classic Jupyter Notebook provides support for text editor and terminal in addition to the popular notebooks? Not a lot of data scientists are aware of this!

But it’s not our fault given that the features were just not integrated and it was no fun working with them. Honestly, it felt like working with three different software instead of one! But thanks to JupyterLab, you will have a much better experience working with these different features.

JupyterLab brings the classic notebooks, text editor, terminal, and directory viewer all under one roof! It is a unified experience that you are bound to love.

JupyterLab also supports other file formats for viewing like jpeg, pdf, CSV, and much more!

Reason #2 – Flexible Layouts

But viewing so many of these windows can become cumbersome. Well, that’s why JupyterLab comes with a flexible layout with which you can organize your workspace in any way you like!

All you have to do is drag and drop, and resize the tabs in whichever way you want. This allows you to comfortably work with multiple tabs at the same time:

JupyterLab provides a collapsible Left sidebar that contains some of the most used tabs, like file browser, running kernels, and a command palette making your work much more efficient:

JupyterLab: Sidebar

Reason #3 –  Rearranging Cells

As a data scientist, I often present my work and results from within Jupyter notebooks. And more often than not, we end up rearranging our cells just so it makes sense to our audience.

It’s in times like these that we wish there was an inherent functionality in Jupyter which would allow us to easily drag and drop cells wherever we want instead of using the old way of cut and paste. Well, this is now possible inside JupyterLab.

You can drag and drop the code cell and place it wherever you want, making the task of rearranging a piece of cake. Now you are bound to get more praise coming your way because your notebooks are so elegant and make much more sense.

Reason #4 – Copying Cells between Notebooks

Dragging and dropping cells within a notebook is one thing, but doing the same between different notebooks is a different ball game altogether.

JupyterLab lets you copy cells from one notebook to another by simply using the drag and drop option:

Reason #5 – Same Notebook, More Views

Working with long notebooks can be irritating at times, especially when you want to explore different parts of the notebook at the same time. That’s where the functionality of multi-views comes in. Now you can have multiple views of the same notebook put side-by-side for comparison inside JupyterLab.

Not only that, once you create a new view, but any change you make to either of the views will also be reflected in either of them and will be saved in the notebook!

I find this functionality useful when I want to select certain columns from the dataframe but don’t exactly remember their name. So, instead of printing the dataframe time and again, I just open the dataframe in a separate view. This prevents me from writing redundant code while viewing the necessary information at the same time – killing two birds with one stone!

Reason #6 – Code Consoles

We all love code consoles for the simplicity they provide. Want to test out a piece of code or check out how to function? Use code consoles! They are our go-to testing place because of the interactivity they provide.

One of the reasons I love using code consoles inside JupyterLab is that you can use them as a log of the computations you have made within a notebook. This is helpful when you want to look at the history of your code.

All you have to do is right-click anywhere in the notebook and select a New Console for Notebook. Then head over to the new console and select Show All Kernel Activity and you are done. Now all the logs for your notebook will be saved in the console:

Reason #7 – Themes Everywhere

Who doesn’t love themes? JupyterLab comes with a built-in Dark theme for the notebook, something that we all crave so much especially when working late nights under dim lights. But Jupyter didn’t stop at that.

They have come up with themes for the Text editor as well as the Terminal. They truly want you to be comfortable with whatever you work with:

Reason #8 – Run Code from a Text File

Sharing a text file with a piece of code written in it? Double-check before sending it – a buggy code does not make a very lasting experience.

JupyterLab lets you create a console for your text file. From here, you can simply highlight your piece of code within the text file, press SHIFT + ENTER, and verify its working:

Reason #9 – Simultaneous Preview for Markdown

Quite often you would want to share your data science project with the community. And it’s in times like these when you turn to a markdown file to document your working.

Markdown files are great because of all the flexibility and functionality they provide. But they get a bit tiring to work within Jupyter when you have to run your cell again and again just to see how your file looks or whether you have used the right syntax.

To overcome this problem, JupyterLab lets you preview your markdown file simultaneously as you are working with it. This is not only much more efficient but also makes it a delight to work with a markdown file:

Reason #10 – Easy Switch to the Classic Notebook View

I was reluctant to add this last feature because I don’t want you to go back to working with Jupyter notebooks. But I do realize it will be hard for some of you to part with something you started your data science journey with.

So, for days when you are missing working with the good old Jupyter notebooks, there is a nice and easy way to switch back to your old workplace. All you have to do is replace the /lab in the URL with /tree:

Frequently Asked Questions

Q1. Is JupyterLab better than Jupyter Notebook?

A. JupyterLab offers a more comprehensive and versatile environment compared to Jupyter Notebook. With its integrated interface and flexible layout, JupyterLab provides enhanced features such as multiple tabs, drag-and-drop functionality, and interactive outputs. It enables a more efficient and interactive workflow for data exploration, analysis, and collaboration, making it a preferred choice for many users.

Q2. What is the purpose of JupyterLab?

A. The purpose of JupyterLab is to provide a flexible and interactive environment for data science, scientific computing, and computational workflows. It offers a comprehensive set of tools and features, including a notebook interface, text editor, terminal, file browser, and more. JupyterLab aims to enhance productivity, collaboration, and exploration by integrating various components and enabling seamless interaction with data and code.

End Notes

I had a blast writing this article and I hope it was convincing enough to make you try out JupyterLab.

There is surely a lot more to JupyterLab that I haven’t covered here. Do let me know in the comments your favorite reason to move to JupyterLab. I would love to hear your thoughts and feedback.

Also, I recommend going over this amazing article on Jupyter hacks, tips, and tricks because even though you will be working with JupyterLab, the underlying Jupyter notebooks are still the same!

I am on a journey to becoming a data scientist. I love to unravel trends in data, visualize it and predict the future with ML algorithms! But the most satisfying part of this journey is sharing my learnings, from the challenges that I face, with the community to make the world a better place!

Responses From Readers

Clear

Lawrence Agbemabiese
Lawrence Agbemabiese

Thank you, Bhandari. i'm sold!

Brao
Brao

Thanks for the write up, I just browsed thru the lab but did not understand much, so instead of using notebook, the syntaxes are written using webpage, is this correct?

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details