Jupyter Lab customization: Make screen settings easy to analyze data like Rstudio / Spyder

2019/11/21

The first programming language I started using was R.The IDE "R studio" was easy to handle even for beginners in programming, and I really liked it. The same applies to the Rstudio-like IDE "Spyder" in Python.

But,Machine learning environment built with DockerThen, it was difficult (for me) to run GUI software like Spyder, so I decided to set Jupyter lab to be easy to use like Rstudio and Spyder.

What is Jupyter Lab?

Jupyter Lab is the successor to Jupyter notebook, an IDE for data science.In the future, the development of Jupyter notebook will be finished once, and it seems that it will move to Jupyter Lab.
For Jupyter Lab, I referred to the following article.

What to aim for after setting

To make Jupyter Lab easier to use, I'd like to use the familiar screen settings in Spyder and Rstudio.

The function you want is ↓

  • Jupyter Notebook window
  • Console window
  • Variable Explorer
Ideal after setting Jupyter Lab like Rstudio (Spyder)
The ideal after setting up Jupyter Lab is like this

Setting method

1. XNUMX. Install / enable Jupyter Lab and extensions

Reference document:JupyterLab Documentation,jupyter_contrib_nbextensions

# You need to install Node.js in advance to use the extension conda install -c conda-forge nodejs # Then install Jupyter Lab and the extension # For pip pip install jupyterlab pip install jupyter_contrib_nbextensions # For conda conda install -c conda-forge jupyterlab conda install -c conda-forge jupyter_contrib_nbextensions
  1. After installing, "jupyter labIs executed.
  2. Press "Enable Extention Maager" from the search window from the Commands tab of Jupyter Lab to enable the extension.
  3. "Extensions" has been added to the tab on the left, so search for "jupyterlab_variable inspector" (a function that becomes a variable explorer) and click Install.
Enable Jupyter Lab, Variable inspector
Enable Variable inspector

2. Notebook / Console window / Variable explorer screen settings

  1. Open "Notebook" from Launcher of Jupyter Lab.
  2. Right-click on Notebook → Open "New Console for Notebook" and "Open Variable Inspector".
  3. Arrange the windows appropriately.
Jupyter Lab Settings Variable inspector

It feels good to have a panoramic view of the Notebook screen, variable explorer, console window, and file explorer.

On the console screen, the code is executed by "Shift + Enter" by default, which is a little troublesome. I have selected "Setting"-> "Console Run Keystroke"-> "Execute with Enter" so that it can be executed only by Enter.

Others

Input assistance

Candidates are displayed and completed with the "tab key" while entering the code.

Jupyter lab input completion
tab: Input completion

Find and replace

"Ctrl + F" will bring up the search screen (Find).You can also replace by clicking the arrow on the left.

Jupyter lab search and replace
Ctrl + c: Find and replace

that's all!