10 Compelling Reasons you Should Use JupyterLab for Data Science Coding
- 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.
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.
Table of Contents
- Reason #1 – Everything under one roof
- Reason #2 – Flexible Layouts
- Reason #3 – Cell rearrangement
- Reason #4 – Copying cells between notebooks
- Reason #5 – Same notebook, more views
- Reason #6 – Code Consoles
- Reason #7 – Themes everywhere
- Reason #8 – Run code from a Text file
- Reason #9 – Simultaneous preview for Markdown
- Reason #10 – Easy switch to classic Notebook view
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:
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:
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!