{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [], "authorship_tag": "ABX9TyPw0MF3Gx8VcPFHJAT7+DFw", "include_colab_link": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "66LJ0DYvE0VT" }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "source": [ "a = [2,4,3,\"fdfd\",[5,6]]" ], "metadata": { "id": "SiB9YNFCFM34" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "a" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "VN9HcJJxFM6P", "outputId": "4d043c99-5b03-4889-e477-fbc1a0c78273" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "[2, 4, 3, 'fdfd', [5, 6]]" ] }, "metadata": {}, "execution_count": 8 } ] }, { "cell_type": "code", "source": [ "a[4][0]" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "dpZJ7o6rFM8h", "outputId": "073a71f5-e916-41e3-c044-14dcacc86837" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "5" ] }, "metadata": {}, "execution_count": 9 } ] }, { "cell_type": "code", "source": [ "b={'alfa':1,\n", "'beta':27, \n", "'gamma':[0,1,2],\n", "'delta':67.3,\n", "'ninety-eight':{\n", " 'a': 5, \n", " 'b':7}\n", " }" ], "metadata": { "id": "SLpBGGrxFM_C" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "b['ninety-eight']['a']" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "dMWo74m8FNBO", "outputId": "5d5c8bf3-8f09-451d-b715-74471d0e0dc8" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "5" ] }, "metadata": {}, "execution_count": 11 } ] }, { "cell_type": "code", "source": [ "b.keys(),b.values()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "b3kDuRkvFNDw", "outputId": "ed754cdd-af27-43be-b662-a6d0280aefdc" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "(dict_keys(['alfa', 'beta', 'gamma', 'delta', 'ninety-eight']),\n", " dict_values([1, 27, [0, 1, 2], 67.3, {'a': 5, 'b': 7}]))" ] }, "metadata": {}, "execution_count": 12 } ] }, { "cell_type": "code", "source": [ "df = pd.read_csv('lowhightrellis.csv')" ], "metadata": { "id": "0QNJ_pl1E9TK" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "df" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 423 }, "id": "wAi_z58QE9Y8", "outputId": "a6fcf87c-5e97-43ec-9b9b-31aeaebf667b" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Entity Year Annual CO2 emissions Billion Tonnes\n", "0 High-income countries 2000 13.814314\n", "1 High-income countries 2001 13.768310\n", "2 High-income countries 2002 13.879006\n", "3 High-income countries 2003 14.132029\n", "4 High-income countries 2004 14.346497\n", ".. ... ... ...\n", "83 Upper-middle-income countries 2017 15.586029\n", "84 Upper-middle-income countries 2018 15.964710\n", "85 Upper-middle-income countries 2019 16.338437\n", "86 Upper-middle-income countries 2020 16.219840\n", "87 Upper-middle-income countries 2021 17.038822\n", "\n", "[88 rows x 3 columns]" ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
EntityYearAnnual CO2 emissions Billion Tonnes
0High-income countries200013.814314
1High-income countries200113.768310
2High-income countries200213.879006
3High-income countries200314.132029
4High-income countries200414.346497
............
83Upper-middle-income countries201715.586029
84Upper-middle-income countries201815.964710
85Upper-middle-income countries201916.338437
86Upper-middle-income countries202016.219840
87Upper-middle-income countries202117.038822
\n", "

88 rows × 3 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 14 } ] }, { "cell_type": "code", "source": [ "df.T" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 358 }, "id": "CwLxR21fE9a3", "outputId": "1e1e3728-d52b-4521-c9de-408fe07c48d6" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " 0 \\\n", "Entity High-income countries \n", "Year 2000 \n", "Annual CO2 emissions Billion Tonnes 13.814314 \n", "\n", " 1 \\\n", "Entity High-income countries \n", "Year 2001 \n", "Annual CO2 emissions Billion Tonnes 13.76831 \n", "\n", " 2 \\\n", "Entity High-income countries \n", "Year 2002 \n", "Annual CO2 emissions Billion Tonnes 13.879006 \n", "\n", " 3 \\\n", "Entity High-income countries \n", "Year 2003 \n", "Annual CO2 emissions Billion Tonnes 14.132029 \n", "\n", " 4 \\\n", "Entity High-income countries \n", "Year 2004 \n", "Annual CO2 emissions Billion Tonnes 14.346497 \n", "\n", " 5 \\\n", "Entity High-income countries \n", "Year 2005 \n", "Annual CO2 emissions Billion Tonnes 14.392103 \n", "\n", " 6 \\\n", "Entity High-income countries \n", "Year 2006 \n", "Annual CO2 emissions Billion Tonnes 14.391346 \n", "\n", " 7 \\\n", "Entity High-income countries \n", "Year 2007 \n", "Annual CO2 emissions Billion Tonnes 14.503344 \n", "\n", " 8 \\\n", "Entity High-income countries \n", "Year 2008 \n", "Annual CO2 emissions Billion Tonnes 14.207814 \n", "\n", " 9 ... \\\n", "Entity High-income countries ... \n", "Year 2009 ... \n", "Annual CO2 emissions Billion Tonnes 13.361896 ... \n", "\n", " 78 \\\n", "Entity Upper-middle-income countries \n", "Year 2012 \n", "Annual CO2 emissions Billion Tonnes 15.168901 \n", "\n", " 79 \\\n", "Entity Upper-middle-income countries \n", "Year 2013 \n", "Annual CO2 emissions Billion Tonnes 15.347986 \n", "\n", " 80 \\\n", "Entity Upper-middle-income countries \n", "Year 2014 \n", "Annual CO2 emissions Billion Tonnes 15.518297 \n", "\n", " 81 \\\n", "Entity Upper-middle-income countries \n", "Year 2015 \n", "Annual CO2 emissions Billion Tonnes 15.348731 \n", "\n", " 82 \\\n", "Entity Upper-middle-income countries \n", "Year 2016 \n", "Annual CO2 emissions Billion Tonnes 15.287409 \n", "\n", " 83 \\\n", "Entity Upper-middle-income countries \n", "Year 2017 \n", "Annual CO2 emissions Billion Tonnes 15.586029 \n", "\n", " 84 \\\n", "Entity Upper-middle-income countries \n", "Year 2018 \n", "Annual CO2 emissions Billion Tonnes 15.96471 \n", "\n", " 85 \\\n", "Entity Upper-middle-income countries \n", "Year 2019 \n", "Annual CO2 emissions Billion Tonnes 16.338437 \n", "\n", " 86 \\\n", "Entity Upper-middle-income countries \n", "Year 2020 \n", "Annual CO2 emissions Billion Tonnes 16.21984 \n", "\n", " 87 \n", "Entity Upper-middle-income countries \n", "Year 2021 \n", "Annual CO2 emissions Billion Tonnes 17.038822 \n", "\n", "[3 rows x 88 columns]" ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
0123456789...78798081828384858687
EntityHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countriesHigh-income countries...Upper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countriesUpper-middle-income countries
Year2000200120022003200420052006200720082009...2012201320142015201620172018201920202021
Annual CO2 emissions Billion Tonnes13.81431413.7683113.87900614.13202914.34649714.39210314.39134614.50334414.20781413.361896...15.16890115.34798615.51829715.34873115.28740915.58602915.9647116.33843716.2198417.038822
\n", "

3 rows × 88 columns

\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 15 } ] }, { "cell_type": "code", "source": [ "df.T.to_dict" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "PvsQg-iBE9c1", "outputId": "0d8ca406-a82c-4270-97d9-68422ad0206d" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "" ] }, "metadata": {}, "execution_count": 16 } ] }, { "cell_type": "code", "source": [ "b.keys()" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Tm-z94G5E9e5", "outputId": "a9748a52-896d-4bcc-9a1e-045fdbe2ab7b" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "dict_keys(['alfa', 'beta', 'gamma', 'delta', 'ninety-eight'])" ] }, "metadata": {}, "execution_count": 17 } ] }, { "cell_type": "code", "source": [ "list ( df.T.to_dict().values() )" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "qVw4ydNGFLZH", "outputId": "a058b499-819c-4125-ebb8-5d4724b8403e" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "[{'Entity': 'High-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 13.814314},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 13.76831},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 13.879006},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 14.132029},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 14.346497},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 14.392103},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 14.391346},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 14.503344},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 14.207814},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 13.361896},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 13.919588},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 13.710742},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 13.646848},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 13.672034},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 13.541289},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 13.504642},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 13.287067},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 13.285368},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 13.34473},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 13.03792},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 11.938873},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 12.516404},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15984282},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 0.16322282},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15231773},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17427158},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17734845},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18179064},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18963666},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19419267},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 0.20696437},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19170944},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 0.1910769},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17830454},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17113435},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 0.1589318},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 0.16848005},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15191834},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15492858},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18865408},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18389006},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19521739},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19159389},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19878296},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 2.77697},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 2.8723914},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 2.9457905},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 3.0782856},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 3.2322355},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 3.3754657},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 3.5282836},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 3.7336602},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 3.8609654},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 4.0282458},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 4.2469786},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 4.5060434},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 4.738324},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 4.820519},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 5.0458317},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 5.2186537},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 5.461015},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 5.655321},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 5.9494026},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 6.161634},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 5.889132},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 6.258658},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 7.7588147},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 7.90476},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 8.305314},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 9.23482},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 9.815747},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 10.549172},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 11.31908},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 11.863421},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 12.569875},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 12.78544},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 13.731335},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 14.796521},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 15.168901},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 15.347986},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 15.518297},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 15.348731},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 15.287409},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 15.586029},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 15.96471},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 16.338437},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 16.21984},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 17.038822}]" ] }, "metadata": {}, "execution_count": 18 } ] }, { "cell_type": "code", "source": [ "exported_values = list( df.T.to_dict().values() )" ], "metadata": { "id": "trj7PQ8MFLbt" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "exported_values" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "9SUtCYKqFLdw", "outputId": "b70e3436-6757-4c73-a395-0933899ad0a8" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "[{'Entity': 'High-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 13.814314},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 13.76831},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 13.879006},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 14.132029},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 14.346497},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 14.392103},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 14.391346},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 14.503344},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 14.207814},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 13.361896},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 13.919588},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 13.710742},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 13.646848},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 13.672034},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 13.541289},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 13.504642},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 13.287067},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 13.285368},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 13.34473},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 13.03792},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 11.938873},\n", " {'Entity': 'High-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 12.516404},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15984282},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 0.16322282},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15231773},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17427158},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17734845},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18179064},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18963666},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19419267},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 0.20696437},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19170944},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 0.1910769},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17830454},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 0.17113435},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 0.1589318},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 0.16848005},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15191834},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 0.15492858},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18865408},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 0.18389006},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19521739},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19159389},\n", " {'Entity': 'Low-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 0.19878296},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 2.77697},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 2.8723914},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 2.9457905},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 3.0782856},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 3.2322355},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 3.3754657},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 3.5282836},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 3.7336602},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 3.8609654},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 4.0282458},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 4.2469786},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 4.5060434},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 4.738324},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 4.820519},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 5.0458317},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 5.2186537},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 5.461015},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 5.655321},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 5.9494026},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 6.161634},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 5.889132},\n", " {'Entity': 'Lower-middle-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 6.258658},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2000,\n", " 'Annual CO2 emissions Billion Tonnes': 7.7588147},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2001,\n", " 'Annual CO2 emissions Billion Tonnes': 7.90476},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2002,\n", " 'Annual CO2 emissions Billion Tonnes': 8.305314},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2003,\n", " 'Annual CO2 emissions Billion Tonnes': 9.23482},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2004,\n", " 'Annual CO2 emissions Billion Tonnes': 9.815747},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2005,\n", " 'Annual CO2 emissions Billion Tonnes': 10.549172},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2006,\n", " 'Annual CO2 emissions Billion Tonnes': 11.31908},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2007,\n", " 'Annual CO2 emissions Billion Tonnes': 11.863421},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2008,\n", " 'Annual CO2 emissions Billion Tonnes': 12.569875},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2009,\n", " 'Annual CO2 emissions Billion Tonnes': 12.78544},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2010,\n", " 'Annual CO2 emissions Billion Tonnes': 13.731335},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2011,\n", " 'Annual CO2 emissions Billion Tonnes': 14.796521},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2012,\n", " 'Annual CO2 emissions Billion Tonnes': 15.168901},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2013,\n", " 'Annual CO2 emissions Billion Tonnes': 15.347986},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2014,\n", " 'Annual CO2 emissions Billion Tonnes': 15.518297},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2015,\n", " 'Annual CO2 emissions Billion Tonnes': 15.348731},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2016,\n", " 'Annual CO2 emissions Billion Tonnes': 15.287409},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2017,\n", " 'Annual CO2 emissions Billion Tonnes': 15.586029},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2018,\n", " 'Annual CO2 emissions Billion Tonnes': 15.96471},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2019,\n", " 'Annual CO2 emissions Billion Tonnes': 16.338437},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2020,\n", " 'Annual CO2 emissions Billion Tonnes': 16.21984},\n", " {'Entity': 'Upper-middle-income countries',\n", " 'Year': 2021,\n", " 'Annual CO2 emissions Billion Tonnes': 17.038822}]" ] }, "metadata": {}, "execution_count": 20 } ] }, { "cell_type": "code", "source": [ "import json" ], "metadata": { "id": "eS3Q9fv5FLf_" }, "execution_count": null, "outputs": [] }, { "cell_type": "code", "source": [ "open('trellisweek9.json', 'w').write( json.dumps(exported_values) )" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "53uXj4HpFLiW", "outputId": "ff805fcb-bab0-46ec-d3df-0f5c46cd0d90" }, "execution_count": null, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "9216" ] }, "metadata": {}, "execution_count": 22 } ] } ] }