Jupyter Notebook shortcuts for Mac

I always find myself pressed for time and so shortcuts are a huge help in getting straight to the point. Below or some shortcuts I’ve learned along the way when using Jupyter Notebook.
Adding or removing a cell
- The cell will be highlighted green. Press the “ESC” key on the top left corner of your Mac keyboard to highlight the cell blue

2. If you want to add a cell above the highlighted one press the “A” key or if you want to add a cell below press the “B” key

3. If you want to delete a cell make sure you have the right cell selected blue and press the “X” key

4. If you accidentally delete the wrong cell no problem you can retrieve it.
First, make sure your cell is highlighted in blue by pressing the “ESC ”key. Then press the “Z” key

Find and Replace
- If you’re looking to find items in your notebook press the “COMMAND + F” keys together to type your search

2. If you are looking to find & replace items in your notebook first make sure your cell is highlighted blue by pressing the “ESC” button. After, press the “F” key, a prompt will appear. In the find, bar enter the item you are searching for and in the replace bar enter the item you want to replace the search word with. Click the results button which is to the left of the find bar. Finally, click the replace all button at the bottom right corner of the prompt window.

Opening and Closing Punctuation
- Highlight what you want to enclose with your punctuation by pressing “COMMAND + SHIFT + RIGHT ARROW KEY (or LEFT KEY)” depending on where your cursor is

2. Once highlighted add your punctuation. In the example below, we are using “SHIFT + 9” to populate with opening and closing parenthesis. But you can use this shortcut with ‘ ’, “ ” , ( ) , {} , [].

Auto filling variables
Sometimes I find myself typing variables over and over again. Instead, you can auto-fill them by starting to type your variable and then pressing the TAB button.

Viewing Documentation
If you want to view or further understand the parameters you want to enter for a method press the SHIFT + TAB keys after you’ve entered the method.

Viewing methods for an object
If you want to view what methods a specific object has, type an object in a cell then press the TAB key.

Commenting a line
To comment out a whole line press the “COMMAND + /” on the line you want to be commented.

Help Function
If you want to view what libraries are installed with python on your Jupyter Notebook go to a cell and type in “help(‘modules’)” and press “ENTER+SHIFT”. You can also use the help() function to find detailed documentation on any objects or functions.
help (‘modules’)

help(str)

There’s More…
- For more shortcuts in Jupyter Notebook, press the ESC key to highlight a cell blue. Then press the H key. A prompt should appear with more shortcuts for your needs.

2. You can also press “COMMAND + SHIFT + P” to pull up the command palette for more shortcuts.

Hope this helps you in your endeavor to learn the ins and outs of Jupyter Notebook. Thank you for reading.