This article was published as a part of the Data Science Blogathon
This article provides the following learning objectives-
The Jupyter community has exponentially grown over the years due to its intuitive data science features. An advanced jupyter project has been released, known as JupyterLab which is one step ahead of Jupyter notebooks.
JupyterLab is an open-source interactive web-based user interface for Project Jupyter. It is a development environment for working with notebooks, code, and data. JupyterLab has full support for Jupyter notebooks with multiple integration facilities. JupyterLab enables the usage of text editors, terminals, debuggers, data file viewers simultaneously in a tabbed workspace. It supports multiple notebooks as tabs in the same window. JupyterLab is famous for its Jupyter notebook-based IDE.
There are more than one reasons to use JupyterLab for data science. JupyterLab has been primarily developed as an optimal platform for streamlining end-to-end data science pipelines. It has become an indispensable tool for data scientists all over the world.
JupyterLab provides extraordinary features for displaying independent in-line visualizations. Many times there is a requirement of viewing a particular output. This use case can be solved easily by using the JupyterLab 3.0 interface unlike any other traditional IDE like VSCode. In Jupyter notebook, any cell can be executed at any time in the notebook to produce an output. This can be extremely useful for performing EDA. JupyterLab lets users display visualizations and markdowns alongside the code itself enabling a better representation and explanation.
While working on complex data science problems it is an additional advantage to keep track of the state of execution of each cell. Jupiter’s automatic caching allows storage of the output of every cell for future reference.
JupyterLab provides platform and language independence. It has support for most of the common languages used by data scientists such as Python, R, and Julia along with numerous file formats like Html, markdown, etc.
Jupyter Notebook provides standard user interfaces for exploring code and data interactivity. Allowing the users to edit and run the code on the way thus making the code dynamic. Interactiveness improves code performance and makes way for users to make changes according to their needs.
It’s time to switch to JupyterLab 3.0 which has all the latest upgrades along with all the exciting jupyter features. There’s not one, but multiple reasons for using JupyterLab 3.0.
JupyterLab 3.0 provides a single environment for notebooks, editors, directory discovery, and debuggers. We can work with different file formats such as jpeg, pdf, CSV, etc.
We can arrange files and activities side by side by using tabs and splitters under the same roof. JupyterLab provides drag and drops features to simultaneously perform various activities in a tabbed environment. We can easily resize the tabs for better usage. Right, and left Sidebars panels are available for workspace efficiency.
Saving the code computation history can serve great advantage in many ways. They can be used as a record of the code in the notebooks saved in the console. Many times we need to validate our code block where the code console can be handy.
Highlighted views of the same notebook can be presented in several ways for a better coding experience. A particular part of the notebook can be viewed separately side-by-side for comparison inside the JupyterLab workspace. Any made in the view will be reflected and saved in the notebook. This helps to view the necessary information without the hassle of scrolling back and forth.
With jupyter notebooks, we could shift and copy cells within the same notebook. But with JupyterLab we can copy cells between multiple notebooks by simple drag and drop facility.
https://cluebots.com/blog/default-anaconda-applications
JupyterLab has been regularly coming up with newer updates to enhance the user experience with each version. JupyterLab 3.0 has also introduced some amazing functionalities-
A default front-end debugger has been introduced that enables notebooks, code consoles, and files to be debugged directly from the JupyterLab interface!
The visual debugger can be made available, by installing a kernel with debugging support. The following kernels support the Jupyter Debug Protocol:
Installation of xeus-python
First, create a new conda environment then start with the installation.
conda create -n newenv -c conda-forge jupyterlab=3 xeus-python conda activate newenv
Now the xeus-python kernel can be selected kernel from the launcher or using the kernel selection dialogue.
Why limit the interface content to a single language when you can select any language of your choice?
JupyterLab3.0 provides the facility to change your interface language according to your choice by installing a language pack. This link lists the language packs available.
Installation of the language pack
The code can be changed according to the language <language code>
conda install -c conda-forge jupyterlab-language-pack-<language code>
After installation, language settings need to be reset in the interface to activate the language. Accept the confirmation box and refresh to view the changed interface.
Extensions are a crucial part of JupiterLab interactive experience, as JupyterLab is formed over an extensible system.
Another way of distributing and installing extensions has been made available in JupyterLab 3.0 as pip or Conda packages. Earlier versions required NodeJS binding with JupyterLab to Install extensions. Now the hassle of rebuilding JupyterLab and the distribution of extensions as npm packages can be avoided by directly installing.
conda install -c conda-forge jupyterlab-python-file
OR
pip install jupyterlab-python-file
The installed extension is a python file, it can be replaced with any JupyterLab extension.
User-side interface changes include-
a. Right interactive Sidebar panels
b. Floating command palette
c. filtering files by fuzzy matching
d. Simple Interface mode toggle
JupyterLab 3.0 now depends on the Jupyter Server, a new Jupyter project based on the server portion of the classic Notebook server. Jupyter Server is the backend for the core services needed for Jupyter web applications.
Table of content extension as a part of core provides an easy way to view and navigate through the notebooks and files. We can view the table of content by clicking on the auto-numbering Toggle along with it the description can also be seen. This extension is one of the most used extensions and provides a more user-rich experience.
JupyterLab can be installed using various means such as-
conda install -c conda-forge jupyterlab
mamba install -c conda-forge jupyterlab
pip install jupyterlab
pipenv install jupyterlab pipenv shell
virtualenv should be activated if using pipenv to launch jupyter lab.
JupyterLab3.0 can be installed by selecting any ready-to-run Docker images maintained by the Jupyter Team. The docker command should include
-e JUPYTER_ENABLE_LAB=yes
to enable jupyterLab inside the container.
Other than this Official documentation should be referred for further information about JupyterLab 3.0.
The media shown in this article are not owned by Analytics Vidhya and are used at the Author’s discretion.