This is a test page for integrating IPython notebook into the blog. The following file came from Jake Vanderplas's blog.

Add the following line into the markdown file:

{% notebook path/to/notebook.ipynb [cells[i:j]] %}

This inserts the notebook at the given location in the post, optionally selecting a given range of notebook cells with standard Python list slicing syntax.

This is the first line of the notebook

In [1]:
print("Hello World")
Hello World

Some equation \(f(x) = \exp(-\alpha x) \cos(x)\).

In [5]:
from numpy import exp, cos

def f(x, alpha=0.1):
    """The equation implemented in a Python function"""
    return exp(- alpha * x) * cos(x)

Now create a plot of the function:

In [6]:
%matplotlib inline
import pylab as p
In [16]:
xs = p.linspace(0, 40, 200)
p.plot(xs, f(xs, 0.1), label ='f(x, 0.1)')
p.plot(xs, f(xs, 0.2), '--', label ='f(x, 0.2)')
p.xlabel('x')
p.legend()
Out[16]:
<matplotlib.legend.Legend at 0x1084b0650>

The last line of the notebook.

For simple comparison, here goes an equation inline: $E = mc^2$.