Created
April 29, 2018 02:49
-
-
Save cab938/ef422f9775cd6b1f5caadcee3934a7f0 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
#!pip install html5lib #install html5lib, only needs to be run once | |
#You might need to restart kernel after running with the menu Kernel>Restart | |
import pandas as pd | |
import numpy as np | |
from scipy import stats | |
df=pd.read_html('https://proxy.mentoracademy.org/getContentFromUrl/?userid=user&url=https://www.ncdc.noaa.gov/cag/global/time-series/asia/land/ytd/12/1910-2016', header=0)[0] | |
pop1=df[df['Year']<1950]['Anomaly(1910-2000 Base Period)'].apply(lambda x: x.split('°C')[0]).astype(float) | |
pop2=df[df['Year']>=1950]['Anomaly(1910-2000 Base Period)'].apply(lambda x: x.split('°C')[0]).astype(float) | |
print("Mean anomaly values before 1950 {}, and mean after 1950 {}".format(np.mean(pop1),np.mean(pop2))) | |
if stats.ttest_ind(pop1,pop2)[1] <= 0.01: | |
print("Test was statistically significant at p<0.01 value.") | |
else: | |
print("Test was not statistically significant at p<0.01 value.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment