Info Session — Mentor-Led Data Science & AI Program

Register
Academy

What Are The Jupyter Notebook Shortcuts?

Magnimind Academy · · Updated · 3 min read

What Are The Jupyter Notebook Shortcuts? — Magnimind Academy article illustration

If you want to write code a lot faster and in an easier way, you just can’t ignore the benefits of Jupyter Notebook shortcuts. This can be especially helpful if you’re using Jupyter Notebook for Python.

Jupyter notebook is a flexible, open-source web application that helps you create and share readable analyses and documents, which contain images, live codes, comments, equations, formulae, narrative texts, visualizations, and plots together. In other words, the Jupyter notebook contains both code (for instance, Python) and rich text elements (such as equations, paragraphs, etc). You can use it for machine learning, numerical simulation, data cleaning and transformation, data visualization, statistical modeling, and a lot more. If you want to write code a lot faster and in an easier way, you just can’t ignore the benefits of Jupyter Notebook shortcuts. This can be especially helpful if you’re using Jupyter Notebook for Python.

Jupyter Notebook Shortcuts
Jupyter Notebook Shortcuts

Important Jupyter Notebook shortcuts

Table of Contents

Some important Jupyter Notebook shortcuts

Before talking about the shortcuts, you need to remember a key thing:

Jupyter has two modes, namely

  • Edit mode, where you can type text, code, etc. into a cell, and the cell border would have a green color.
  • Command mode, which binds the keyboard to actions at the notebook level and lets you move from cell to cell with the selected cell having a blue left margin.

If you’re in the edit mode, you can press escto move to the command mode. From the command mode, you’ll need to press enter to move to the edit mode on the cell that you have selected.

Given below are some Jupyter Notebook shortcutsthat would make your job easier and help save precious time.

Illustration from the Magnimind Academy data science blog

Edit Mode

Edit Mode

For navigation

Ctrl + up arrow or Ctrl + Home– to go to cell start

Ctrl + down arrow or Ctrl + End – to go to cell end

Ctrl + left arrow – to go to the start of the present or previous word

Ctrl + right arrow – to go to the end of present or next word

For formatting

Ctrl + a – to select all

Ctrl + / – to toggle comment of present (or selected) line(s)

Ctrl + ] – to indent present (or selected) line(s)

Ctrl + [ – to unindent present (or selected) line(s)

Ctrl + z – to undo your last action

Ctrl + y or Ctrl + shift + z – to redo your last action

For miscellaneous actions

Optio + scrolling click – to do column editing

Tab – to conclude code or indent

Ctrl + shift + - – to split cell

Shift + tab – for tooltip

Illustration from the Magnimind Academy data science blog

Command Mode

Command Mode

H – to show all the shortcuts

A – to insert a new cell above the present cell

B – to insert a new cell below the present cell

M – to change the present cell to Markdown mode (which is good for documentation)

Y – to change the present cell back to code

C – to copy cell

V – to paste cell

D + D (you’ll have to press the key twice) – to delete the present cell

Shift + up – to extend chosen cells above

Shift + down – to extend chosen cells below

Ctrl + enter – to run the chosen cell

Alt + enter or Shift + enter – to run the present cell, select below

Esc + i i – to interrupt kernel

Esc + 0 0 – to restart kernel

Shift + M – to merge chosen cells, or the present cell with the cell below in case only one cell is selected

P – to open the command palette

Illustration from the Magnimind Academy data science blog

Conclusion

Conclusion

You can use all these Jupyter Notebook shortcuts in your daily work. You can also visit the menu bar’s Help > Edit Keyboard Shortcuts link to edit the existing shortcuts or add more shortcuts.

Topics in this article

Keep reading

Related posts

Picked by shared topics and what other readers are reading this month.

Data Science

Shares: Python

How To Use PostgreSQL In A Jupyter Notebook?

Jupyter notebooks can be powerful tools to connect to your remote database. They allow you to streamline, replicate, and document your data. In this tutorial, using a Jupyter notebook, we will briefly see how to connect to a PostgreSQL database, which is a popular open-source relational…

· 3 min read

Read article →
Python

Shares: Python

From Notebook to API: Serving Models With FastAPI and Docker

Transitioning a machine learning model from a research notebook to a production-ready API requires more than just wrapping code. This guide examines the technical implementation of model deployment using FastAPI and Docker, focusing on asynchronous request handling, containerization best practices, and the infrastructure needed to maintain reliable inference services.

· 10 min read

Read article →
Python

Shares: Python

Python Performance: Vectorization, Numba, and Knowing When to Stop

A technical guide to optimizing Python performance using vectorization and Numba. We examine the mechanics of the Python interpreter, the overhead of object creation, and the specific thresholds where Numba's JIT compilation outperforms NumPy. The article provides a framework for deciding when further optimization results in diminishing returns.

· 9 min read

Read article →
Browse all 218 articles →

Next step

How can we help?

Choose the path that matches what you need so your message reaches the right team.

Choosing a program?

Meet us live, compare programs, ask about fit, and hear the next cohort dates.

Book an info session

Something else?

Contact us for support, partnerships, hiring, press, or any general question.

Contact us