In [1]:
#apply styles to notebook (rather than doing it locally 
# via the profile custom.css file)
from IPython.core.display import HTML
css_file = 'media/style.css'
HTML(open(css_file, "r").read())


Out[1]:
/* Adapted from https://github.com/ketch/teaching-numerics-with-notebooks */

Intro to IPython Notebook

![](media/npp.png)

What We'll Cover

  • IPython Notebook: what is it?
  • Problems. We have them.
  • Getting up and running
  • Next steps/beyond basics

What We Can't

  • Technical Architecture
  • Specific installation problems
  • Advanced topics in detail

First Things First

iPython

IPython Notebook: What is It?

IPython notebook is part of IPython, an interactive computing architecture.

The IPython Notebook is a web-based interactive computational environment where you can combine code execution, text, mathematics, plots and rich media into a single document.


In [2]:
#some Python code
range(0,20)


Out[2]:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]

Markdown and LaTeX support


In [3]:
from IPython.display import YouTubeVideo
# a talk about IPython at Sage Days at U. Washington, Seattle.
# Video credit: William Stein.
YouTubeVideo('QTXyXuqfBLA')


Out[3]:

In [4]:
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
x = np.linspace(0, 3*np.pi, 500)
plt.plot(x, np.sin(x**2))
plt.title('chirp chirp');


How Does it Help?

Show Your Work

Warming Ocean Threatens Sea Life, Scientific American

IPython notebook

NBViewer

Sharing Without Scaring

Getting Started

Anaconda Distribution

Linux, Mac, Windows downloads: https://store.continuum.io/cshop/anaconda/

  1. Install
  2. Open Anaconda Launcher
    • Windows: Start Menu
    • Mac: Launcher.app in ~/anaconda
  3. Install IPython Notebook
  4. Launch IPython Notebook. This should start up the notebook server and open the notebook dashboard in your browser.

Getting Started

Existing Python Environment

IPython supports Python 2.7 or 3.3 and newer.

  1. Install IPython and it's main optional dependencies (many of these are needed to run the Notebook):
     pip install ipython[all]
  2. If you get an error installing ipython[notebook], install dependencies separately:
    • pip install jinja2
    • pip install sphinx
    • pip install pyzmq
    • pip install pygments
    • pip install tornado
    • pip install ipython
  3. Start the notebook server. This should start up the server and open the notebook dashboard in your browser.
    • ipython notebook
  4. Alternately, to start a notebook server from a VM, make sure you're forwarding port 8888 start up the server:

What's Happening?

  • Dashboard shows notebooks in the current directory
  • Each open notebook is connected to a single Python kernal
  • Notebooks are a series of cells (code cells, Markdown, etc.)

More information

Behind the Scenes

What's Next

Roadmap slates IPython 3.0 for fall 2014:

  • Continue developing interactive widgets
  • Further development of non-Python kernels
  • Multi-user notebooks
  • Jupyter

Questions?

Becky Sweger
bsweger@gmail.com
@bendystraw