Jupyter

Misc

  • Docs

  • Kernel Menu Commands (navbar)

    • Interrupt: This command stops the processes that are currently running in a cell. This can be used, for example, to stop the training of a model, even if not all training epochs have been reached yet.
    • Restart & Run All: With this command, all cells can be executed again and the previous variables were deleted. This can be useful if you want to read a newer data set into the existing program.
    • Restart: The sole command “Restart” leads to the same result, but not all cells are executed again.
    • Reconnect: When training large models, the kernel can “die” because the memory is full. Then a reconnect makes sense.
    • Shutdown: As long as a kernel is still running, it also ties up memory. If you run other programs in parallel for which you want to free memory, the “Shutdown” command can make sense.
  • Add HTML to markdown cells

  • Limit Length of Cell Output

    • Right click output cell >> Click “Enable Scrolling for Outputs”

Shortcuts

  • Preloaded
Description Shortcut
shift + Enter Run current cell and select the cell below
ctrl/cmd + Enter Run current cell
alt/option + Enter Run current cell and insert another cell below
ctrl/cmd + s Save notebook
i, i Interupt cell calculation
0, 0 Restart cell calculation
  • Custom
    • Create/Edit

      1. Navbar >> Settings >> Advanced Settings Editor
      2. Click JSON Settings Editor (Top Right)
      3. CLick on User Preferences tab
    • Example

      {
          "command": "notebook:move-cell-up",
          "keys": [
              "Ctrl Shift ArrowUp"
          ],
          "selector": ".jp-Notebook:focus"
      },
      {
          "command": "notebook:move-cell-down",
          "keys": [
              "Ctrl Shift ArrowDown"
          ],
          "selector": ".jp-Notebook:focus"
      },

Operations

  • First click inside cell >> Press Esc to enter Command mode (Cursor should stop blinking)

Insert/Delete Cells

  • a - Insert new cell above current cell
  • dd (press d twice) - Delete current cell
  • b - Insert new cell below current cell

Change Cell Type

  • m - Markdown mode (for writing comments and headers)
  • y - Code mode

Select Multiple Cells

  • While holding Shift + use the \(\uparrow\) or \(\downarrow\) to expand the selection