Hello Sphinx!

IPython notebooks are great! Sphinx is cool as well. Let us add the two to have better docs. Let us do a bit of IPython jugglery. This page shows a demo of using some of IPython functionality and embedding it in sphinx docs.

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline

Creating a dummy Pandas dataframe

df = pd.DataFrame(np.random.randn(50,2))

How does the dataframe display render?

0 1
0 2.658950 -1.113648
1 -0.638310 -0.109605
2 0.565121 1.423637
3 -0.612912 1.177100
4 1.267664 -1.739509

5 rows × 2 columns

What about plots?


How about maths?

\[x = \frac{y}{y+1}\]

Here is the IPython notebook corresponding to this page and here is the github repo corresponding to this minimal example! Many people are already using this scheme. I just documented it for my benefit (and possibly someone else also may find it useful).

Nipun Batra