Exemple de notebook iPython (ou Jupyter, c'est pareil)

Des expressions Python

In [ ]:
2 + 2
In [ ]:
x = 42
In [ ]:
x * 2

Des formules LaTeX

Calculons maintenant $\sin({\pi \over 2})$ :

In [ ]:
import math
In [ ]:
math.sin(math.pi / 2)

Des Courbes

In [ ]:
%matplotlib inline
In [ ]:
import matplotlib.pyplot as plt
import numpy as np
In [ ]:
x = np.linspace(0, 5, 1000)
y = np.sin(x)
In [ ]:
plt.plot(x, y)
In [ ]:
z = np.cos(x)
plt.plot(x, z)