Integrate.py

Integrate x² from 0 to 5
import scipy.integrate as integrate result = integrate.quad(lambda x: x**2, 0, 5) print (result[0])

import scipy.integrate as integrate import numpy integrand = lambda x: numpy.exp(-x**2) integrate.quad(integrand,0,numpy.inf)