from sympy import*from sympy.abc import x,y,a,b,c,d
import math
pi = math.pi
aa = solve([(2*pi*x)**(-0.5)*(exp(-(0-y)**2/2*(x**2))-11),(2*pi*x)**(-0.5)*(exp(-(1-y)**2/2*(x**2))-5)],[x,y])print(aa)
求积分
from scipy import integrate
deff(x):return x +1
v, err = integrate.quad(f,1,2)
卡方检验
import numpy as np
from scipy import stats
from scipy.stats import chisquare
list_observe=[30,14,34,45,57,20]
list_expect=[20,20,30,40,60,30]
std=np.std(data,ddof=1)print(chisquare(f_obs=list_observe, f_exp=list_expect))
p=chisquare(f_obs=list_observe, f_exp=list_expect)[1]if p>0.05or p==“nan”:print"H0 win,there is no difference"else:print"H1 win,there is difference"