Testing notebooks with Nikola

This post is just a quick exploration of the capabilities of Nikola with jupyter notebooks

To create a post from a Jupyter notebook:

nikola new_post -f ipynb --tags=Nikola -t "Testing notebooks with Nikola"

nikola build   

nikola serve -b   

nikola github_deploy

this for inline display of matplotlib plots

In [1]:
%matplotlib inline

some imports

In [2]:
from matplotlib import pyplot as plt 
import numpy as np
import pandas as pd

testing inline plots

In [3]:
np.random.seed(1234)
In [4]:
x = np.random.randn(1000)
In [5]:
x = np.cumsum(x)
In [6]:
df = pd.DataFrame(x, columns=['x'], index=pd.date_range(start='2000-1-1', periods=len(x)))
In [7]:
df.plot(legend=None, figsize=(10, 6), grid=True);

equations with MathJax

$$e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i$$

pandas dataframes

In [8]:
df.head()
Out[8]:
x
2000-01-01 -1.085631
2000-01-02 -0.088285
2000-01-03 0.194693
2000-01-04 -1.311601
2000-01-05 -1.890202

Comments