<jupyter_start><jupyter_text>Global Temperature -- Data from [NASA website](https://climate.nasa.gov/vital-signs/global-temperature)<jupyter_code>T = pd.read_table('647_Global_Temperature_Data_File.txt',\
                  sep='     ',engine='python',index_col='year')
T.head()
T['Annual mean'].plot(kind='bar',figsize=[16,4])
plt.show()
T.plot(title='temperature trend')
# T['Lowess smoothing'].plot()
# plt.savefig('temperature trend.png')
plt.show()<jupyter_output><empty_output><jupyter_text>$CO_2$ Trend -- Data from [NASA website](https://climate.nasa.gov/vital-signs/carbon-dioxide/)<jupyter_code>co2 = pd.read_table('co2data.txt',sep='\s+')
co2.head()
co2mean = co2.groupby('year')['trend'].mean()
co2mean.plot(title='$CO_2$ trend')
plt.savefig('co2 trend.png')
plt.show()<jupyter_output><empty_output><jupyter_text>大西洋热带气旋 -- 数据来源：维基百科<jupyter_code># 数据爬取和整理
hurc = pd.read_html('https://en.wikipedia.org/wiki/Atlantic_hurricane_season')
hurc.pop(0);
hurc = pd.concat(hurc,ignore_index=True).set_index('Year')

hurri = hurc.drop(columns=['Number of\ntropical\ncyclones','Number of\ntropical cyclones',\
                          'Number of\ntropical\nstorms','Number of\ntropical storms',\
                          'Number of\nmajor\nhurricanes','Number of\nmajor hurricanes',\
                           'Number of\nhurricanes'])
hurri['number of tropical cyclones']=\
hurc['Number of\ntropical\ncyclones'].add(hurc['Number of\ntropical cyclones'],fill_value=0)
hurri['number of tropical storms']=\
hurc['Number of\ntropical\nstorms'].add(hurc['Number of\ntropical storms'],fill_value=0)
hurri['number of hurricanes']=hurc['Number of\nhurricanes']
hurri['number of major hurricanes']=\
hurc['Number of\nmajor\nhurricanes'].add(hurc['Number of\nmajor hurricanes'],fill_value=0)
# hurri.to_excel('cyclonehit_wiki.xlsx')
# hurri.head()
hurri.loc[:,idx['number of tropical cyclones':\
                'number of major hurricanes']].plot(title='extreme whether activities')
# plt.savefig('extreme whether activities.png')
plt.show()
hur = pd.read_excel('cyclonehit_wiki.xlsx')
hur.set_index('Year',inplace=True)
hur.head()<jupyter_output><empty_output><jupyter_text>Tropical Cyclone 发生次数趋势<jupyter_code>total = hur['number of major hurricanes']+hur['number of hurricanes']+\
hur['number of tropical storms']
total.drop(index=2018,inplace=True)
ratio = pd.DataFrame({'major hurricane':hur['number of major hurricanes']/total,
                    'hurricane':hur['number of hurricanes']/total,
                    'storm':hur['number of tropical storms']/total})
ratio.dropna(inplace=True)
from sklearn.linear_model import LinearRegression
total.plot(linestyle='',marker='.')
model = LinearRegression(fit_intercept=True)
model.fit(total.index.values[:, np.newaxis], total)
yfit = model.predict(total.index.values[:, np.newaxis])
plt.plot(total.index.values[:, np.newaxis],yfit,linewidth = 2,color='blue')
plt.title('number of total TC in Atlantic ocean')
plt.savefig('number of total TC in Atlantic ocean.png')
plt.show()<jupyter_output><empty_output><jupyter_text>三种气旋占总量的比例及其趋势<jupyter_code>model = LinearRegression(fit_intercept=True)
model.fit(ratio.index.values[:, np.newaxis], ratio)
yfit = model.predict(ratio.index.values[:, np.newaxis])
ratio.plot(marker='o',linestyle='',markersize=3)
plt.plot(ratio.index.values[:, np.newaxis],yfit)
plt.title('trend of three tropical cyclones')
plt.ylabel('Propotion of three sorts of TC')
plt.savefig('trend of three tropical cyclones')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16586333994896513, 'fraction_numerical': 0.007088176920895945, 'mean_word_length': 5.931237721021611, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '605649', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1263, 'n_words': 189, 'path': 'jupyternb/Tropical Cyclones and Global Warming.ipynb', 'repo_name': 'Black-Web/notbooks', 'size': '3527'}