SciPy

scipy.special.legendre

scipy.special.legendre(n, monic=0)[source]

Returns the nth order Legendre polynomial, P_n(x), orthogonal over [-1,1] with weight function 1.