Welcome.

5 Minute Super-Simple Guide to Using iPython/Jupyter Notebooks

No matter what you call it– you can’t dispute it’s convenient.

A Jupiter notebook.

A python notebook.

A python notebook.

I can’t decide which one I want more. They’re both pretty cute.

 

So what is it, already?

It’s a Word document you can code in.

In all seriousness, it’s a web application, designed for use in the data sciences.

iPython is a sub-project under Project Jupyter (which supports a whole toooooon of languages, not just Python). Project Jupyter was started in 2014, so although its Jupyter notebooks now, a lot of people still call them iPython notebooks. And yes, it takes some time to get used to spelling Jupyter.

JU-PY-TER

 

Let’s work our way down from the top.

 

jupyter-header

 

 

And take a look at the menu…

jupyter-menu

 

 

I just want to go through things that I think are useful, because most of it is very self-explanatory. So let’s start with Jupyter’s time travel device.

file-menu
“Save and Checkpoint” and “Revert to Checkpoint” are its own built-in version control system, which is more convenient than saving it before every major change.

 

That brings us to the Edit menu.

edit-menu

The Edit menu allows you to easily edit the metadata.

metadata

 

The rest of the menu bar is pretty easy to understand, which brings us to a fun feature: Widgets.

widgets-menu

 

Widgets can make your notebook come alive by adding interactivity to your notebook. Here’s some examples:

 

scatterplot

 

An interactive scatterplot you can explore.

 

3-d-visualization

 

A 3-D visualization you can explore from all angles.

 

Adding these widgets and more (customized maps!) make it a lot easier to turn your ideas into engaging data visualizations with Jupyter.

 

Now for buttons…

 

jupyter-buttons

 

The Save button is obviously there, but what is that little cross next to it?

jupyter-add button

It adds a cell to your notebook (shown below).

The thing that is unique about Jupyter is that you run your code directly in the application, with the output coming out all nice and neat in its little box.

input-output

Another useful feature is that you can run the code section by section so that if you (GOD FORBID!) have a mistake, you don’t have to run your environment all over again from the beginning.

 

Next are the handy yet dangerous Cut, Copy and Paste buttons.

jupyter-edit-button

 

They cut, copy and can paste your cells, but be sure to be saving and adding checkpoints in case you hit the cut button by accident.

 

jupyter-up-down-button

The next buttons move cells up and down.  Pretty easy to use.

 

jupyter-run-button

The next buttons are pretty important.  The first one runs your currently selected cell, the stop button stops your kernel and the reset button resets it.

 

jupyter-markdown-button

The next menu formats your cells.  There are three options: Code, Markdown and Raw NBConvert.

 

jupyter-command-button

The next button opens up a handy little search menu of all the commands for Jupyter Notebook.

search-box

 

 

The next button is accessible two ways. Through this button:
jupyter-cell-toolbar-button

And the View Menu:

cell-toolbar-menu

They both open a menu with a couple of different options to view the Notebook.  I’m not sure why it’s really there.

This post is just designed to give the very basics of how to use Jupyter Notebooks. I highly recommend working your way through Rackspace’s Python Jupyter Notebook tutorial (in a Jupyter Notebook!).

Have fun!

Kristen

Leave a reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>