Created
February 7, 2018 15:24
-
-
Save gschivley/89e903d8f5806f2ad0cd54371a709caf to your computer and use it in GitHub Desktop.
Transform emissions data
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
{ | |
"cells": [ | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "# Example of transform to tidy format\nThis notebook gives a short example of how one data file can be read from file with Pandas and transformed to a tidy format. I haven't done anything about formatting emission names. Operations between data sets might be easier with a multiindex to allow for easy matching of emissions/countries/years." | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:14:18.473680Z", | |
"end_time": "2018-02-07T15:14:19.625314Z" | |
}, | |
"trusted": true, | |
"collapsed": true | |
}, | |
"cell_type": "code", | |
"source": "import pandas as pd\nfrom os.path import join", | |
"execution_count": 1, | |
"outputs": [] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Import one data file" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:14:23.836836Z", | |
"end_time": "2018-02-07T15:14:23.860933Z" | |
}, | |
"trusted": true, | |
"collapsed": true | |
}, | |
"cell_type": "code", | |
"source": "fn = join('inputs', 'emission_data_EDGAR_FAO.csv')\ndf = pd.read_csv(fn, sep=';', header=[0, 1], index_col=0)\ndf = df.iloc[:, :-1] # drop last column", | |
"execution_count": 2, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:14:27.183088Z", | |
"end_time": "2018-02-07T15:14:27.261330Z" | |
}, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "df.head()", | |
"execution_count": 3, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"execution_count": 3, | |
"data": { | |
"text/plain": "Countries CO2 total excl. Land Use excl. BB (ktCO2) Unnamed: 2_level_0 \\\n 1990 1995 \nAfghanistan 2013.73 2305.02 \nAlbania 6486.03 2065.37 \nAlgeria 67632.52 80029.04 \nAndorra NaN NaN \nAngola 11285.76 13025.84 \n\nCountries Unnamed: 3_level_0 Unnamed: 4_level_0 Unnamed: 5_level_0 \\\n 2000 2005 2010 \nAfghanistan 2456.66 3074.88 6357.08 \nAlbania 3137.54 4161.30 4092.34 \nAlgeria 84056.33 97923.23 116212.87 \nAndorra NaN NaN NaN \nAngola 16601.29 16199.45 24409.17 \n\nCountries CH4 ( ktCH4) Unnamed: 7_level_0 Unnamed: 8_level_0 \\\n 1990 1995 2000 \nAfghanistan 363.22 375.52 446.87 \nAlbania 121.28 131.84 124.23 \nAlgeria 1538.07 1885.86 2145.37 \nAndorra NaN NaN NaN \nAngola 1050.30 1020.02 750.40 \n\nCountries Unnamed: 9_level_0 Unnamed: 10_level_0 ... \\\n 2005 2010 ... \nAfghanistan 509.46 642.54 ... \nAlbania 117.96 123.45 ... \nAlgeria 2225.59 2267.88 ... \nAndorra NaN NaN ... \nAngola 778.98 885.83 ... \n\nCountries SF6 tot (ktSF6) Unnamed: 27_level_0 Unnamed: 28_level_0 \\\n 1990 1995 2000 \nAfghanistan 0.00 0.0 0.00 \nAlbania 0.00 0.0 0.00 \nAlgeria 0.01 0.0 0.01 \nAndorra NaN NaN NaN \nAngola 0.00 0.0 0.00 \n\nCountries Unnamed: 29_level_0 Unnamed: 30_level_0 CO2 Land Use (ktCO2) \\\n 2005 2010 1990 \nAfghanistan 0.00 0.00 0.00 \nAlbania 0.00 0.00 121.15 \nAlgeria 0.01 0.01 880.00 \nAndorra NaN NaN -19.46 \nAngola 0.00 0.00 83384.43 \n\nCountries Unnamed: 32_level_0 Unnamed: 33_level_0 Unnamed: 34_level_0 \\\n 1995 2000 2005 \nAfghanistan 0.00 0.00 0.00 \nAlbania 121.15 121.34 889.36 \nAlgeria 880.00 880.00 513.33 \nAndorra -19.46 -19.46 -28.92 \nAngola 83384.43 82397.21 94767.62 \n\nCountries Unnamed: 35_level_0 \n 2010 \nAfghanistan 0.00 \nAlbania -211.04 \nAlgeria -6746.67 \nAndorra -38.94 \nAngola 81040.65 \n\n[5 rows x 35 columns]", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead tr th {\n text-align: left;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr>\n <th>Countries</th>\n <th>CO2 total excl. Land Use excl. BB (ktCO2)</th>\n <th>Unnamed: 2_level_0</th>\n <th>Unnamed: 3_level_0</th>\n <th>Unnamed: 4_level_0</th>\n <th>Unnamed: 5_level_0</th>\n <th>CH4 ( ktCH4)</th>\n <th>Unnamed: 7_level_0</th>\n <th>Unnamed: 8_level_0</th>\n <th>Unnamed: 9_level_0</th>\n <th>Unnamed: 10_level_0</th>\n <th>...</th>\n <th>SF6 tot (ktSF6)</th>\n <th>Unnamed: 27_level_0</th>\n <th>Unnamed: 28_level_0</th>\n <th>Unnamed: 29_level_0</th>\n <th>Unnamed: 30_level_0</th>\n <th>CO2 Land Use (ktCO2)</th>\n <th>Unnamed: 32_level_0</th>\n <th>Unnamed: 33_level_0</th>\n <th>Unnamed: 34_level_0</th>\n <th>Unnamed: 35_level_0</th>\n </tr>\n <tr>\n <th></th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n <th>...</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>Afghanistan</th>\n <td>2013.73</td>\n <td>2305.02</td>\n <td>2456.66</td>\n <td>3074.88</td>\n <td>6357.08</td>\n <td>363.22</td>\n <td>375.52</td>\n <td>446.87</td>\n <td>509.46</td>\n <td>642.54</td>\n <td>...</td>\n <td>0.00</td>\n <td>0.0</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n </tr>\n <tr>\n <th>Albania</th>\n <td>6486.03</td>\n <td>2065.37</td>\n <td>3137.54</td>\n <td>4161.30</td>\n <td>4092.34</td>\n <td>121.28</td>\n <td>131.84</td>\n <td>124.23</td>\n <td>117.96</td>\n <td>123.45</td>\n <td>...</td>\n <td>0.00</td>\n <td>0.0</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>121.15</td>\n <td>121.15</td>\n <td>121.34</td>\n <td>889.36</td>\n <td>-211.04</td>\n </tr>\n <tr>\n <th>Algeria</th>\n <td>67632.52</td>\n <td>80029.04</td>\n <td>84056.33</td>\n <td>97923.23</td>\n <td>116212.87</td>\n <td>1538.07</td>\n <td>1885.86</td>\n <td>2145.37</td>\n <td>2225.59</td>\n <td>2267.88</td>\n <td>...</td>\n <td>0.01</td>\n <td>0.0</td>\n <td>0.01</td>\n <td>0.01</td>\n <td>0.01</td>\n <td>880.00</td>\n <td>880.00</td>\n <td>880.00</td>\n <td>513.33</td>\n <td>-6746.67</td>\n </tr>\n <tr>\n <th>Andorra</th>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>...</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>-19.46</td>\n <td>-19.46</td>\n <td>-19.46</td>\n <td>-28.92</td>\n <td>-38.94</td>\n </tr>\n <tr>\n <th>Angola</th>\n <td>11285.76</td>\n <td>13025.84</td>\n <td>16601.29</td>\n <td>16199.45</td>\n <td>24409.17</td>\n <td>1050.30</td>\n <td>1020.02</td>\n <td>750.40</td>\n <td>778.98</td>\n <td>885.83</td>\n <td>...</td>\n <td>0.00</td>\n <td>0.0</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>83384.43</td>\n <td>83384.43</td>\n <td>82397.21</td>\n <td>94767.62</td>\n <td>81040.65</td>\n </tr>\n </tbody>\n</table>\n<p>5 rows × 35 columns</p>\n</div>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Create a new multiindex for columns" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:16:04.408705Z", | |
"end_time": "2018-02-07T15:16:04.418413Z" | |
}, | |
"trusted": true, | |
"collapsed": true | |
}, | |
"cell_type": "code", | |
"source": "iterables = [['CO2 total excl. Land Use excl. BB (ktCO2)',\n 'CH4 ( ktCH4)',\n 'N2O (ktN2O)',\n 'HFC tot (GWP100, ktCO2e)',\n 'PFC tot (GWP100, ktCO2e)',\n 'SF6 tot (ktSF6)',\n 'CO2 Land Use (ktCO2)'], \n [1990,1995,2000,2005,2010]]\n\nidx = pd.MultiIndex.from_product(iterables, names=['emission', 'year'])\n\ndf.columns = idx", | |
"execution_count": 7, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:16:04.868933Z", | |
"end_time": "2018-02-07T15:16:04.931602Z" | |
}, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "df.head()", | |
"execution_count": 8, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"execution_count": 8, | |
"data": { | |
"text/plain": "emission CO2 total excl. Land Use excl. BB (ktCO2) \\\nyear 1990 1995 2000 \nAfghanistan 2013.73 2305.02 2456.66 \nAlbania 6486.03 2065.37 3137.54 \nAlgeria 67632.52 80029.04 84056.33 \nAndorra NaN NaN NaN \nAngola 11285.76 13025.84 16601.29 \n\nemission CH4 ( ktCH4) \\\nyear 2005 2010 1990 1995 2000 2005 \nAfghanistan 3074.88 6357.08 363.22 375.52 446.87 509.46 \nAlbania 4161.30 4092.34 121.28 131.84 124.23 117.96 \nAlgeria 97923.23 116212.87 1538.07 1885.86 2145.37 2225.59 \nAndorra NaN NaN NaN NaN NaN NaN \nAngola 16199.45 24409.17 1050.30 1020.02 750.40 778.98 \n\nemission ... SF6 tot (ktSF6) \\\nyear 2010 ... 1990 1995 2000 2005 2010 \nAfghanistan 642.54 ... 0.00 0.0 0.00 0.00 0.00 \nAlbania 123.45 ... 0.00 0.0 0.00 0.00 0.00 \nAlgeria 2267.88 ... 0.01 0.0 0.01 0.01 0.01 \nAndorra NaN ... NaN NaN NaN NaN NaN \nAngola 885.83 ... 0.00 0.0 0.00 0.00 0.00 \n\nemission CO2 Land Use (ktCO2) \nyear 1990 1995 2000 2005 2010 \nAfghanistan 0.00 0.00 0.00 0.00 0.00 \nAlbania 121.15 121.15 121.34 889.36 -211.04 \nAlgeria 880.00 880.00 880.00 513.33 -6746.67 \nAndorra -19.46 -19.46 -19.46 -28.92 -38.94 \nAngola 83384.43 83384.43 82397.21 94767.62 81040.65 \n\n[5 rows x 35 columns]", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead tr th {\n text-align: left;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr>\n <th>emission</th>\n <th colspan=\"5\" halign=\"left\">CO2 total excl. Land Use excl. BB (ktCO2)</th>\n <th colspan=\"5\" halign=\"left\">CH4 ( ktCH4)</th>\n <th>...</th>\n <th colspan=\"5\" halign=\"left\">SF6 tot (ktSF6)</th>\n <th colspan=\"5\" halign=\"left\">CO2 Land Use (ktCO2)</th>\n </tr>\n <tr>\n <th>year</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n <th>...</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n <th>1990</th>\n <th>1995</th>\n <th>2000</th>\n <th>2005</th>\n <th>2010</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>Afghanistan</th>\n <td>2013.73</td>\n <td>2305.02</td>\n <td>2456.66</td>\n <td>3074.88</td>\n <td>6357.08</td>\n <td>363.22</td>\n <td>375.52</td>\n <td>446.87</td>\n <td>509.46</td>\n <td>642.54</td>\n <td>...</td>\n <td>0.00</td>\n <td>0.0</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n </tr>\n <tr>\n <th>Albania</th>\n <td>6486.03</td>\n <td>2065.37</td>\n <td>3137.54</td>\n <td>4161.30</td>\n <td>4092.34</td>\n <td>121.28</td>\n <td>131.84</td>\n <td>124.23</td>\n <td>117.96</td>\n <td>123.45</td>\n <td>...</td>\n <td>0.00</td>\n <td>0.0</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>121.15</td>\n <td>121.15</td>\n <td>121.34</td>\n <td>889.36</td>\n <td>-211.04</td>\n </tr>\n <tr>\n <th>Algeria</th>\n <td>67632.52</td>\n <td>80029.04</td>\n <td>84056.33</td>\n <td>97923.23</td>\n <td>116212.87</td>\n <td>1538.07</td>\n <td>1885.86</td>\n <td>2145.37</td>\n <td>2225.59</td>\n <td>2267.88</td>\n <td>...</td>\n <td>0.01</td>\n <td>0.0</td>\n <td>0.01</td>\n <td>0.01</td>\n <td>0.01</td>\n <td>880.00</td>\n <td>880.00</td>\n <td>880.00</td>\n <td>513.33</td>\n <td>-6746.67</td>\n </tr>\n <tr>\n <th>Andorra</th>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>...</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>NaN</td>\n <td>-19.46</td>\n <td>-19.46</td>\n <td>-19.46</td>\n <td>-28.92</td>\n <td>-38.94</td>\n </tr>\n <tr>\n <th>Angola</th>\n <td>11285.76</td>\n <td>13025.84</td>\n <td>16601.29</td>\n <td>16199.45</td>\n <td>24409.17</td>\n <td>1050.30</td>\n <td>1020.02</td>\n <td>750.40</td>\n <td>778.98</td>\n <td>885.83</td>\n <td>...</td>\n <td>0.00</td>\n <td>0.0</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>0.00</td>\n <td>83384.43</td>\n <td>83384.43</td>\n <td>82397.21</td>\n <td>94767.62</td>\n <td>81040.65</td>\n </tr>\n </tbody>\n</table>\n<p>5 rows × 35 columns</p>\n</div>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Melt the df to tidy, re-add country names for the index" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:17:05.892603Z", | |
"end_time": "2018-02-07T15:17:05.911332Z" | |
}, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "df2 = df.melt()\nindex = list(df.index) * 5 * 7 # 5 years and 7 emission types\n\ndf2.index = index\ndf2.head()", | |
"execution_count": 9, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"execution_count": 9, | |
"data": { | |
"text/plain": " emission year value\nAfghanistan CO2 total excl. Land Use excl. BB (ktCO2) 1990 2013.73\nAlbania CO2 total excl. Land Use excl. BB (ktCO2) 1990 6486.03\nAlgeria CO2 total excl. Land Use excl. BB (ktCO2) 1990 67632.52\nAndorra CO2 total excl. Land Use excl. BB (ktCO2) 1990 NaN\nAngola CO2 total excl. Land Use excl. BB (ktCO2) 1990 11285.76", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>emission</th>\n <th>year</th>\n <th>value</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>Afghanistan</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>2013.73</td>\n </tr>\n <tr>\n <th>Albania</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>6486.03</td>\n </tr>\n <tr>\n <th>Algeria</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>67632.52</td>\n </tr>\n <tr>\n <th>Andorra</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Angola</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>11285.76</td>\n </tr>\n </tbody>\n</table>\n</div>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "markdown", | |
"source": "## Easily slice null values" | |
}, | |
{ | |
"metadata": { | |
"ExecuteTime": { | |
"start_time": "2018-02-07T15:20:15.403976Z", | |
"end_time": "2018-02-07T15:20:15.435924Z" | |
}, | |
"trusted": true | |
}, | |
"cell_type": "code", | |
"source": "df2.loc[df2['value'].isnull()]", | |
"execution_count": 10, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"execution_count": 10, | |
"data": { | |
"text/plain": " emission \\\nAndorra CO2 total excl. Land Use excl. BB (ktCO2) \nEuropean Union CO2 total excl. Land Use excl. BB (ktCO2) \nLiechtenstein CO2 total excl. Land Use excl. BB (ktCO2) \nMarshall Islands CO2 total excl. Land Use excl. BB (ktCO2) \nMicronesia, Federated States of CO2 total excl. Land Use excl. BB (ktCO2) \nMonaco CO2 total excl. Land Use excl. BB (ktCO2) \nMontenegro CO2 total excl. Land Use excl. BB (ktCO2) \nNiue CO2 total excl. Land Use excl. BB (ktCO2) \nSan Marino CO2 total excl. Land Use excl. BB (ktCO2) \nSerbia CO2 total excl. Land Use excl. BB (ktCO2) \nAndorra CO2 total excl. Land Use excl. BB (ktCO2) \nEuropean Union CO2 total excl. Land Use excl. BB (ktCO2) \nLiechtenstein CO2 total excl. Land Use excl. BB (ktCO2) \nMarshall Islands CO2 total excl. Land Use excl. BB (ktCO2) \nMicronesia, Federated States of CO2 total excl. Land Use excl. BB (ktCO2) \nMonaco CO2 total excl. Land Use excl. BB (ktCO2) \nMontenegro CO2 total excl. Land Use excl. BB (ktCO2) \nNiue CO2 total excl. Land Use excl. BB (ktCO2) \nSan Marino CO2 total excl. Land Use excl. BB (ktCO2) \nSerbia CO2 total excl. Land Use excl. BB (ktCO2) \nAndorra CO2 total excl. Land Use excl. BB (ktCO2) \nEuropean Union CO2 total excl. Land Use excl. BB (ktCO2) \nLiechtenstein CO2 total excl. Land Use excl. BB (ktCO2) \nMarshall Islands CO2 total excl. Land Use excl. BB (ktCO2) \nMicronesia, Federated States of CO2 total excl. Land Use excl. BB (ktCO2) \nMonaco CO2 total excl. Land Use excl. BB (ktCO2) \nMontenegro CO2 total excl. Land Use excl. BB (ktCO2) \nNiue CO2 total excl. Land Use excl. BB (ktCO2) \nSan Marino CO2 total excl. Land Use excl. BB (ktCO2) \nSerbia CO2 total excl. Land Use excl. BB (ktCO2) \n... ... \nMontenegro SF6 tot (ktSF6) \nSan Marino SF6 tot (ktSF6) \nSerbia SF6 tot (ktSF6) \nEritrea CO2 Land Use (ktCO2) \nEuropean Union CO2 Land Use (ktCO2) \nInt. Aviation CO2 Land Use (ktCO2) \nInt. Shipping CO2 Land Use (ktCO2) \nMarshall Islands CO2 Land Use (ktCO2) \nMontenegro CO2 Land Use (ktCO2) \nPalau CO2 Land Use (ktCO2) \nSerbia CO2 Land Use (ktCO2) \nEuropean Union CO2 Land Use (ktCO2) \nInt. Aviation CO2 Land Use (ktCO2) \nInt. Shipping CO2 Land Use (ktCO2) \nMontenegro CO2 Land Use (ktCO2) \nSerbia CO2 Land Use (ktCO2) \nEuropean Union CO2 Land Use (ktCO2) \nInt. Aviation CO2 Land Use (ktCO2) \nInt. Shipping CO2 Land Use (ktCO2) \nMontenegro CO2 Land Use (ktCO2) \nSerbia CO2 Land Use (ktCO2) \nEuropean Union CO2 Land Use (ktCO2) \nInt. Aviation CO2 Land Use (ktCO2) \nInt. Shipping CO2 Land Use (ktCO2) \nMontenegro CO2 Land Use (ktCO2) \nSerbia CO2 Land Use (ktCO2) \nEuropean Union CO2 Land Use (ktCO2) \nInt. Aviation CO2 Land Use (ktCO2) \nInt. Shipping CO2 Land Use (ktCO2) \nSerbia and Montenegro CO2 Land Use (ktCO2) \n\n year value \nAndorra 1990 NaN \nEuropean Union 1990 NaN \nLiechtenstein 1990 NaN \nMarshall Islands 1990 NaN \nMicronesia, Federated States of 1990 NaN \nMonaco 1990 NaN \nMontenegro 1990 NaN \nNiue 1990 NaN \nSan Marino 1990 NaN \nSerbia 1990 NaN \nAndorra 1995 NaN \nEuropean Union 1995 NaN \nLiechtenstein 1995 NaN \nMarshall Islands 1995 NaN \nMicronesia, Federated States of 1995 NaN \nMonaco 1995 NaN \nMontenegro 1995 NaN \nNiue 1995 NaN \nSan Marino 1995 NaN \nSerbia 1995 NaN \nAndorra 2000 NaN \nEuropean Union 2000 NaN \nLiechtenstein 2000 NaN \nMarshall Islands 2000 NaN \nMicronesia, Federated States of 2000 NaN \nMonaco 2000 NaN \nMontenegro 2000 NaN \nNiue 2000 NaN \nSan Marino 2000 NaN \nSerbia 2000 NaN \n... ... ... \nMontenegro 2010 NaN \nSan Marino 2010 NaN \nSerbia 2010 NaN \nEritrea 1990 NaN \nEuropean Union 1990 NaN \nInt. Aviation 1990 NaN \nInt. Shipping 1990 NaN \nMarshall Islands 1990 NaN \nMontenegro 1990 NaN \nPalau 1990 NaN \nSerbia 1990 NaN \nEuropean Union 1995 NaN \nInt. Aviation 1995 NaN \nInt. Shipping 1995 NaN \nMontenegro 1995 NaN \nSerbia 1995 NaN \nEuropean Union 2000 NaN \nInt. Aviation 2000 NaN \nInt. Shipping 2000 NaN \nMontenegro 2000 NaN \nSerbia 2000 NaN \nEuropean Union 2005 NaN \nInt. Aviation 2005 NaN \nInt. Shipping 2005 NaN \nMontenegro 2005 NaN \nSerbia 2005 NaN \nEuropean Union 2010 NaN \nInt. Aviation 2010 NaN \nInt. Shipping 2010 NaN \nSerbia and Montenegro 2010 NaN \n\n[252 rows x 3 columns]", | |
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>emission</th>\n <th>year</th>\n <th>value</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>Andorra</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Liechtenstein</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Marshall Islands</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Micronesia, Federated States of</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Monaco</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Niue</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>San Marino</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Andorra</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Liechtenstein</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Marshall Islands</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Micronesia, Federated States of</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Monaco</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Niue</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>San Marino</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Andorra</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Liechtenstein</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Marshall Islands</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Micronesia, Federated States of</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Monaco</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Niue</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>San Marino</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 total excl. Land Use excl. BB (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>...</th>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>SF6 tot (ktSF6)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>San Marino</th>\n <td>SF6 tot (ktSF6)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>SF6 tot (ktSF6)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Eritrea</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Aviation</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Shipping</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Marshall Islands</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Palau</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1990</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Aviation</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Shipping</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>1995</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Aviation</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Shipping</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2000</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2005</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Aviation</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2005</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Shipping</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2005</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Montenegro</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2005</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2005</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>European Union</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Aviation</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Int. Shipping</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n <tr>\n <th>Serbia and Montenegro</th>\n <td>CO2 Land Use (ktCO2)</td>\n <td>2010</td>\n <td>NaN</td>\n </tr>\n </tbody>\n</table>\n<p>252 rows × 3 columns</p>\n</div>" | |
}, | |
"metadata": {} | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true, | |
"collapsed": true | |
}, | |
"cell_type": "code", | |
"source": "", | |
"execution_count": null, | |
"outputs": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"name": "py36", | |
"display_name": "py36", | |
"language": "python" | |
}, | |
"varInspector": { | |
"window_display": false, | |
"cols": { | |
"lenName": 16, | |
"lenType": 16, | |
"lenVar": 40 | |
}, | |
"kernels_config": { | |
"python": { | |
"library": "var_list.py", | |
"delete_cmd_prefix": "del ", | |
"delete_cmd_postfix": "", | |
"varRefreshCmd": "print(var_dic_list())" | |
}, | |
"r": { | |
"library": "var_list.r", | |
"delete_cmd_prefix": "rm(", | |
"delete_cmd_postfix": ") ", | |
"varRefreshCmd": "cat(var_dic_list()) " | |
} | |
}, | |
"types_to_exclude": [ | |
"module", | |
"function", | |
"builtin_function_or_method", | |
"instance", | |
"_Feature" | |
] | |
}, | |
"language_info": { | |
"name": "python", | |
"version": "3.6.2", | |
"mimetype": "text/x-python", | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"pygments_lexer": "ipython3", | |
"nbconvert_exporter": "python", | |
"file_extension": ".py" | |
}, | |
"gist": { | |
"id": "", | |
"data": { | |
"description": "Transform emissions data", | |
"public": true | |
} | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment