Skip to content

Instantly share code, notes, and snippets.

View cab938's full-sized avatar

Christopher Brooks cab938

View GitHub Profile
#!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)))
!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 = #put the cleaned list of all temperature anomalies for pre 1950
pop2 = #put the cleaned list of all temperature anomalies for 1950 and above
print("Mean anomaly values before 1950 {}, and mean after 1950 {}".format(np.mean(pop1),np.mean(pop2)))
#!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/northAmerica/land/ytd/12/1880-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)))
!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/northAmerica/land/ytd/12/1880-2016', header=0)[0]
pop1 = #put the cleaned list of all temperature anomalies for pre 1950
pop2 = #put the cleaned list of all temperature anomalies for 1950 and above
print("Mean anomaly values before 1950 {}, and mean after 1950 {}".format(np.mean(pop1),np.mean(pop2)))
#!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/northAmerica/land/ytd/12/1880-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)))
!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/globe/land/ytd/12/1910-2016', header=0)[0]
pop1 = #put the cleaned list of all temperature anomalies for pre 1950
pop2 = #put the cleaned list of all temperature anomalies for 1950 and above
print("Mean anomaly values before 1950 {}, and mean after 1950 {}".format(np.mean(pop1),np.mean(pop2)))
#!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
import urllib
#description and prices of the Xeon Gold processors
df_xeon_golds=pd.read_html('https://proxy.mentoracademy.org/getContentFromUrl/?userid=brooks&url=https://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors', header=0)[78]
#statistics about the performance of a range of Intel processors from cpu-monkey
df_stats=pd.read_csv('https://proxy.mentoracademy.org/getContentFromUrl/?userid=brooks&url=https://gist.github.com/cab938/6499da85d31cfccc9cc5b13621963312/raw/34db3b55bd14f39fc59e6b5128b667a9061f77d7/cpu_performance.csv')
performance processor
4355.0 Intel Xeon Platinum 8180M28x 2.50 GHz (3.80 GHz) HT
4355.0 Intel Xeon Platinum 818028x 2.50 GHz (3.80 GHz) HT
4068.0 AMD Epyc 760132x 2.20 GHz (3.20 GHz) HT
4002.0 Intel Xeon Platinum 816824x 2.70 GHz (3.70 GHz) HT
3912.0 AMD Epyc 750132x 2.00 GHz (3.00 GHz) HT
3873.0 Intel Xeon Platinum 817628x 2.10 GHz (3.80 GHz) HT
3873.0 Intel Xeon Platinum 8176M28x 2.10 GHz (3.80 GHz) HT
3873.0 Intel Xeon Platinum 8176F28x 2.10 GHz (3.80 GHz) HT
3838.0 AMD Epyc 755132x 2.00 GHz (3.00 GHz) HT
#!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
df_power=pd.read_csv('https://proxy.mentoracademy.org/getContentFromUrl/?userid=brooks&url=https%3A%2F%2Fgist.github.com%2Fcab938%2Ffb463f56781fae4dd1fc171def0f1e94%2Fraw%2Fa6a7e255dadb09a29cf05de692fc16b4c09e941c%2Findia_power.csv')
df_states=pd.read_csv('https://proxy.mentoracademy.org/getContentFromUrl/?userid=brooks&url=https%3A%2F%2Fgist.github.com%2Fcab938%2Ff8862f40901442ae61b458327d13ef9f%2Fraw%2F13dff6567589592828ee15778d0d5897cf09f335%2Findia_states.csv')
joined_df=pd.merge(df_states, df_power, left_on=["State or union territory"], right_on=["State"], how="inner") #join frames and only consider places we have data for both the state pop and renewables
#!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
df_power=pd.read_csv('https://proxy.mentoracademy.org/getContentFromUrl/?userid=brooks&url=https%3A%2F%2Fgist.github.com%2Fcab938%2F71e8371ebc621a105afa2181efd78e75%2Fraw%2Ffafe9712373ab5a1d3b2fdb6ac09a28cbcfe8f82%2Fus_power.csv')
df_states=pd.read_csv('https://proxy.mentoracademy.org/getContentFromUrl/?userid=brooks&url=https%3A%2F%2Fgist.github.com%2Fcab938%2Ffaedc9046a01b2170c0b252fbc4fc416%2Fraw%2Ff5fa5974e7fef6b996e8ff8583f8d5b47ce391c5%2Fus_states.csv')
joined_df=pd.merge(df_states, df_power, left_on=["state"], right_on=["state"], how="inner") #join frames and only consider places we have data for both the state pop and renewables