from sympy import *
import pandas
from IPython.display import *
init_printing(use_latex=True)
var('a b x sigma mu')
pdf = Lambda((x,mu,sigma),
(1/(sigma * sqrt(2*pi)) * exp(-(mu-x)**2 / (2*sigma**2)))
)
cdf = Lambda((a,b,mu,sigma),
integrate(
pdf(x,mu,sigma),(x,a,b)
)
)
tbl = [['$\pm \sigma$','Area']]
for s in range(1,5):
tbl.append(['%d' % s,'%.4f' % N(cdf(-s,s,0,1))])
df = pandas.DataFrame(tbl)
HTML(df.to_html(header=None,index=None))