Created
March 23, 2021 09:20
-
-
Save HeenaR17/905b2794fc739189c64a70043c41c9f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Creating poisson distribution for ages of students in the school (population) and one particular class (sample) | |
import scipy.stats as stats | |
import pandas as pd | |
import math | |
school=stats.poisson.rvs(loc=18,mu=35,size=1500) | |
classA=stats.poisson.rvs(loc=18,mu=30,size=60) | |
ttest,p_value=ttest_1samp(classA,popmean=school.mean()) | |
if p_value >= 0.5: | |
print("Accept null hypothesis") | |
else: | |
print("Reject null hypothesis") | |
# Output: Reject null hypothesis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment