The Jupyter notebook is an open source semi language agnostic programming development environment aimed at simplifiying the creation and sharing of documents that contain live code, figures, and explanatory text. The Jupyter package is installed by default as part of the Anaconda environment and can be updated using the conda package management system.
-
To open a jupyer notebook, first open a windows or OSX terminal.
-
Via the command line, navigate to the folder in which you would like to open the notebook.
-
Then type the following in your terminal:
jupyter notebook
-
In your default web browser (e.g. Firefox, Chrome, or Safari), you should now see a window that looks like this.
-
To open a new notebook, navigate to the
New
drop down menu in the upper right corner and selectPython 3
from the new menu.
-
Rename the notebook by clicking on the
Untitled
at the top of the page. That will spawn this window:
- The light gray boxes are Python interpreter cells in which code can be executed. Here, we write the code
print("hello world")
.
- To run the the code, we press
<shift>
+<enter>
. The results are printed in the white cell underneath the code cell.
A Jupyter notebook consists of cells. Each cell can contain code or text. The menubar for managing these cells is at the top of the notebook under the file menu. Hovering over the menu items yields their function. The menubar looks like this:
Jupyter notebook also provides a set of keyboard shortcuts for managing these cells. You can read more about them at http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Notebook%20Basics.html#Keyboard-Navigation