> For the complete documentation index, see [llms.txt](https://hs764.gitbook.io/cee-5735/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hs764.gitbook.io/cee-5735/anaconda/jupyter-notebook.md).

# Jupyter Notebook

Jupyter notebook is a web application for developing, documenting, & sharing code. It's become pretty popular among data scientists for visualizing & analyzing datasets, but there's some limitations.

### Documentation

{% embed url="<https://jupyter-notebook.readthedocs.io/en/stable/index.html>" %}

### Starting Jupyter Notebook

Jupyter Notebook is one of the default applications on the Navigator homepage. Another way is to open Jupyter Notebook is by using Terminal; make sure that you are in the correct directory and then use the following command:

```bash
$ jupyter notebook
```

The Jupyter dashboard should open on your default web browser:

![](https://3071976149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIB5AI4iyB7O4uln8Ob%2F-MIN3TZ2-n5fYTJWVhtT%2F-MIN5QJaAV3Um5KXl52f%2FScreen%20Shot%202020-09-29%20at%2012.19.39%20AM.png?alt=media\&token=f11b5165-8779-4c11-bf00-9c0b4ada60fa)

Navigate into your desired directory and then select *Python 3* under *New* to create a Python 3 Notework. This will open up an empty notebook, which you can then name by clicking on *Untitled*. To open a pre-existing notebook, simply click on the .iypnb file and make sure that the kernel is connected.

![](https://3071976149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIB5AI4iyB7O4uln8Ob%2F-MIN3TZ2-n5fYTJWVhtT%2F-MIN6T1SKDvxMl1Oin0Y%2FScreen%20Shot%202020-09-29%20at%2012.27.09%20AM.png?alt=media\&token=1be93831-9c3f-4d9d-82aa-8dd743a4f39a)

### Understanding Cells

Within a ***coding cell***, you can write snippets of code. When you run a cell, the code is sent to a ***kernel*** that executes it. Variables can be called or used from previously ran cells.

![](https://3071976149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIB5AI4iyB7O4uln8Ob%2F-MIMnbN7-Us8lvMomji-%2F-MIMup1JKZaKk2w38H_g%2FScreen%20Shot%202020-09-28%20at%2011.27.19%20PM.png?alt=media\&token=9fe0c6a4-fea8-4466-970b-e66815d76da1)

To run a cell, you can either click on the *Run* button or use Ctrl/Command - Enter. A running cell is indicated by an asterisk. Once the cell has finished running, the asterisk is replaced by a number that tells you the number of cells that you have ran up to that point.&#x20;

![](https://3071976149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIB5AI4iyB7O4uln8Ob%2F-MIPVSmyXvjZK5QTNQvo%2F-MIPWa9m_f509H1vUl7_%2FScreen%20Shot%202020-09-29%20at%2011.40.07%20AM.png?alt=media\&token=97080b34-335d-4835-8656-9ae97889bbd1)

{% hint style="danger" %}
Be careful about the order. Cells can be executed out of order or moved around and variables can be overwritten.
{% endhint %}

***Markdown cells*** allow you to add documentation to your code. Headings can be created using hashtags: # Heading 1, ## Heading 2.

![](https://3071976149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIB5AI4iyB7O4uln8Ob%2F-MIMvdCAc9X4zA1uyz39%2F-MIMwmGYEi8SAD2N-Hxj%2FScreen%20Shot%202020-09-28%20at%2011.38.43%20PM.png?alt=media\&token=56e16d12-bcdf-42f4-b618-faf54d65e7aa)

To run the markdown cell, click *Run* or use Ctrl/Command - Enter.

### Stopping Jupyter Notebook

To shutdown a running notebook, exit the notebook, select the appropriate box from the directory, and click *Shutdown.*

![](https://3071976149-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MIB5AI4iyB7O4uln8Ob%2F-MIPQwbStlT_x7P-Zlsn%2F-MIPT3dcc_Aw6Kc9w9JN%2FScreen%20Shot%202020-09-29%20at%2011.23.48%20AM.png?alt=media\&token=ad09d6bb-f80f-47dd-9976-e6a46096531c)

To exit Jupyter Notebook, click *Quit* on the upper left corner or use Ctrl/Command - C in the Terminal.

### Limitations

There are times when coding with an IDE or text editor is preferable over using Jupyter Notebook. Here is a fun video about several limitations of Jupyter Notebook:

{% embed url="<https://www.youtube.com/watch?v=7jiPeIFXb6U>" %}
