<jupyter_start><jupyter_text><jupyter_code>from io import BytesIO
import urllib, zipfile, requests
 
r = urllib.request.urlopen('https://wri-sites.s3.amazonaws.com/climatewatch.org/www.climatewatch.org/climate-watch/climate-watch-download-zip/ghg-emissions.zip')
with zipfile.ZipFile(BytesIO(r.read())) as z:
    print( z.namelist() )
    z.extractall()
 import pandas as pd
from matplotlib import pyplot as plt
 
df = pd.read_excel('CW_CAIT_GHG_Emissions.xlsx', index_col='Country')
df
clean_df_including_LUCF = df[df.Sector == 'Total including LUCF']
clean_df_all_ghg = clean_df_including_LUCF[clean_df_including_LUCF.Gas == 'All GHG']
clean_df_all_ghg_transposed = clean_df_all_ghg.transpose()
clean_df_all_ghg_transposed = clean_df_all_ghg_transposed.drop(['Source', 'Sector','Gas'])
clean_df_all_ghg_transposed
x_axis = clean_df_all_ghg_transposed.index
 
china  = clean_df_all_ghg_transposed.CHN
usa = clean_df_all_ghg_transposed.USA
india = clean_df_all_ghg_transposed.IND
russia = clean_df_all_ghg_transposed.RUS
japan = clean_df_all_ghg_transposed.JPN
germany = clean_df_all_ghg_transposed.DEU
iran = clean_df_all_ghg_transposed.IRN
south_korea = clean_df_all_ghg_transposed.KOR
saudi_arabia = clean_df_all_ghg_transposed.SAU
indonesia = clean_df_all_ghg_transposed.IDN
 
plt.plot(x_axis,china)
plt.plot(x_axis,usa)
plt.plot(x_axis,india)
plt.plot(x_axis,russia)
plt.plot(x_axis,japan)
plt.plot(x_axis,germany)
plt.plot(x_axis,iran)
plt.plot(x_axis,south_korea)
plt.plot(x_axis,saudi_arabia)
plt.plot(x_axis,indonesia)
 
plt.legend(['China', 'USA', 'India', 'Russia', 'Japan', 'Germany', 'Iran', 'South Korea', 'Saudi Arabia', 'Indonesia'])
plt.title('Green House Gas Emissions Including LUCF')
plt.xlabel('Year')
plt.ylabel('GHG Emissions (Mt)')
 
plt.savefig('/content/drive/MyDrive/topEmitters.png')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12311015118790497, 'fraction_numerical': 0.0005399568034557236, 'mean_word_length': 7.908653846153846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '643822', 'license': 'MIT', 'n_tokens_mistral': 815, 'n_tokens_neox': 768, 'n_words': 102, 'path': 'GHG_Emission_Data_.ipynb', 'repo_name': 'WayneNcube19/Climate-Data-Analysis', 'size': '1852'}