Jupyter

Image

Getting Started

  1. Install jupyter notebook with Anaconda or PIP. https://jupyter.org/

  2. In terminal got to an empty directory and enter: $ jupyter notebook.

  3. A “localhost:8888/tree” page will be created in the browser (Whatever is open). 

  4. Create new notebook by clicking “New” button on top left of the newly opened page.

   

  1. Select “Python Root” or “Python 3”.

  2. An “In [ ]:” field should appear.

  1. If doing this for the first time, select the “User Interface Tour” by clicking the “Help” button on the top of the page.

  2. See the Keyboard shortcuts clicking “Help” button and selecting “Keyboard Shortcuts’.

  3. Hit “Enter” key or click into a cell to go into “Edit” mode, cell will outline to green.

  4. Hit “Esc” key to go into “Command” mode, cell will outline to blue.

 

Example Code

  1. Click into cell and type python command:

  “print(‘Hello World’)

 

  1. Execute code by clicking “Cell” on the top of the screen and select, “Run Cells” or one of the other run options.

  2. Create new cell by clicking “Insert” at top of screen.

  3. Create a variable and set value:

  name = ‘Joe”

  1. Create another new cell and reset the variable value:

      name = ‘GI’

  1. Play with “Run Cells”, “Run Above” and “Run Below” and see what happens.

 

Create Markdown Text as a Heading

  1. Insert cell above top cell.

  2. Click “Cell” at top of the page and select “Cell Type” -> “Markdown”.

  3. Paste in this text and see what happens:

 

# Sample Headline

 

*Note: This text will be italicized. *

 

## Another Headline (H2)

 

This is a normal paragraph.  Now for some Lorem Ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

 

Basic formatting of *italics* and **bold** is supported.  This *can be **nested** like* so.

 

### What this notebook shows

 

1. How to get started with notebooks

2. How to execute code

3. How to add markdown

4. And.. other stuff