Tutorial Brief

The basics of IPython Notebook. It is a web-based interactive development environment. We will cover the basics of managing notebooks and cell types.

Finding Help:

Notebooks

Notebooks are documents representing all input and output of operations. This includes code, text input and numerical, text and rich media output. These files have ipynb extensions.

Cells

Cells can contain code or documentation. We will explore working with cells.

Markdown Cells

This is a markdown cell. In can contain:

  • Markdown language
  • HTML
  • LATEX
**Markdown** *Text*
<strong>HTML formula</strong>
$LATEX%

Markdown Text

HTML

$LATEX formula$

Code Cells

May contain python code and ipython magic.


In [1]:
3+5


Out[1]:
8

In [2]:
1+2
3+5


Out[2]:
8

In [3]:
x = 1
y = 2

x + y


Out[3]:
3

In [7]:
z = x + y
z


Out[7]:
3

IPython Magic


In [ ]:
%%bash
ls
echo "** Creating New File **"
touch test.txt
ls
echo "** Deleting New File **"
rm test.txt

Raw NBConvert

These cells are like markdown but they do not render their input.

This is a Raw NBConvert cell. It doesn't render its contents like **Markdown** HTML $LATEX$ The problem with them is they may render come tags in IPython NBViwer.

Heading Cells

Heading cells are great for creating bookmarks in an IPython Notebook. You can hover over headings to find their link. Usually it is capitalized slug of the title text. This helps in linking to a specific part of a notebook.

Head 1

Head 2

Head 3

Head 4

Head 5
Head 6

Linking to a heading

Linking to a heading is like linking to an HTML Bookmark. You can do that like this:

Relative links:

<a href="#Head-1">Link to Head 1</a>

Link to Head 1

Absolute links:

<a href="http://54.186.15.239:8080/notebooks/IPython%20Tutorial/1%20-%20Notebooks%20%26%20Cells.ipynb#Head-1">Link to Head 1</a>

Link to Head 1