JupyterLab Introduction

What is JupyterLab

JupyterLab is a a free and open source product, interactive, real-time environment to explore data and analyze data. It’s a web-based IDE for Jupyter notebooks, code, and data. JupyterLab is flexible: configure and arrange the user interface to support a wide range of workflows in data science, scientific computing, and machine learning.

JupyterLab vs. Notebook

JupyterLab is a nicer interface on top of Jupyter Notebook. Actually it’s the next generation of the Jupyter Notebook. JupyterLab uses the exact same Notebook server and file format as the classic Jupyter Notebook, so that it is fully compatible with the existing notebooks and kernels. The Classic Notebook and Jupyterlab can run side to side on the same computer.

JupyterLab vs. Excel

Exel is not scalable especially when working with large amont of data. Someone said Jupyter is the new Excel. Many professionals immediately reach for Excel when faced with data-heavy analysis tasks, but for many ‘big data’ challenges it would make sense to work within a Jupyter Notebook instead.

Cell, Cell, Cell

JupyterLib is a sequence of cells. Everything is a cell and everything happens in a cell. There are three cell types: code, markdown and raw. Usually each cell will be either Python code or Markdown text. Raw cell is not evaluated and rarely used. Markdown cell is sort of HTML-like formatted text. And most HTML tag can be accepted inside Markdown cell.

Benefit of using JupyterLab

  • Graphic output can be displayed on the same page by: %matplotlib inline
  • Rich formatted text could be used anywhere by using Markdown language
  • Final result could be exported either as PDF file or HTML file.

Markdown Cheat Sheet

This Markdown cheat sheet provides a quick overview of all the Markdown syntax elements. It can’t cover every edge case, so if you need more information about any of these elements, refer to the reference guides for basic syntax and extended syntax.

Basic Syntax

These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements.

Heading

H1

H2

H3

Bold

bold text

Italic

italicized text

Blockquote

blockquote

Ordered List

  1. First item
  2. Second item
  3. Third item

Unordered List

  • First item
  • Second item
  • Third item

Code

code

Horizontal Rule


Link

title

Image

alt text

Extended Syntax

These elements extend the basic syntax by adding additional features. Not all Markdown applications support these elements.

Table

SyntaxDescription
HeaderTitle
ParagraphText

Fenced Code Block

{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Footnote

Here’s a sentence with a footnote. [^1]

[^1]: This is the footnote.

Heading ID

My Great Heading {#custom-id}

Definition List

term
: definition

Strikethrough

The world is flat.

Task List

  • [x] Write the press release
  • [ ] Update the website
  • [ ] Contact the media

How to use JupyterLab

  • Every cell is given an execution number
  • Mode-based editor – edit mode vs. command mode.
  • Keyboard shortcuts for cell manuipulation (mouse is slow):
  • A : add a new cell above current cell
  • B : add a new cell below current cell
  • DD – delete current cell
  • Escape: switch current cell from edit mode to command mode
  • Enter: switch current cell from command mode to edit mode
  • M: change current cell to Markdown
  • Y: change current cell to Code
  • Ctrl+Enter – execute current cell
  • Shift-Enter – execute current cell and move to next cell
  • Z – undo cell operation
  • C / X / V – Copy , Cut and Past cells