{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:17.313193Z",
"iopub.status.busy": "2020-10-26T15:58:17.312356Z",
"iopub.status.idle": "2020-10-26T15:58:17.633940Z",
"shell.execute_reply": "2020-10-26T15:58:17.633223Z",
"shell.execute_reply.started": "2020-10-26T15:58:17.313111Z"
}
},
"outputs": [],
"source": [
"from read_di_unfccc import UNFCCCApiReader"
]
},
{
"cell_type": "markdown",
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-19T12:08:26.958349Z",
"iopub.status.busy": "2020-10-19T12:08:26.958163Z",
"iopub.status.idle": "2020-10-19T12:08:30.248087Z",
"shell.execute_reply": "2020-10-19T12:08:30.247062Z",
"shell.execute_reply.started": "2020-10-19T12:08:26.958332Z"
}
},
"source": [
"## Using the unified query interface"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:18.142824Z",
"iopub.status.busy": "2020-10-26T15:58:18.142275Z",
"iopub.status.idle": "2020-10-26T15:58:20.896294Z",
"shell.execute_reply": "2020-10-26T15:58:20.895438Z",
"shell.execute_reply.started": "2020-10-26T15:58:18.142765Z"
}
},
"outputs": [],
"source": [
"# instantiate API object, will query metadata\n",
"r = UNFCCCApiReader()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:20.897818Z",
"iopub.status.busy": "2020-10-26T15:58:20.897516Z",
"iopub.status.idle": "2020-10-26T15:58:20.913560Z",
"shell.execute_reply": "2020-10-26T15:58:20.912964Z",
"shell.execute_reply.started": "2020-10-26T15:58:20.897788Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" name | \n",
" noData | \n",
"
\n",
" \n",
" id | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" 3 | \n",
" AUS | \n",
" Australia | \n",
" NaN | \n",
"
\n",
" \n",
" 4 | \n",
" AUT | \n",
" Austria | \n",
" NaN | \n",
"
\n",
" \n",
" 5 | \n",
" BEL | \n",
" Belgium | \n",
" NaN | \n",
"
\n",
" \n",
" 9 | \n",
" CAN | \n",
" Canada | \n",
" NaN | \n",
"
\n",
" \n",
" 10 | \n",
" CHE | \n",
" Switzerland | \n",
" NaN | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 100214 | \n",
" VNM | \n",
" Viet Nam | \n",
" NaN | \n",
"
\n",
" \n",
" 100215 | \n",
" YEM | \n",
" Yemen | \n",
" NaN | \n",
"
\n",
" \n",
" 100216 | \n",
" ZMB | \n",
" Zambia | \n",
" NaN | \n",
"
\n",
" \n",
" 100217 | \n",
" ZWE | \n",
" Zimbabwe | \n",
" NaN | \n",
"
\n",
" \n",
" 100229 | \n",
" PSE | \n",
" State of Palestine | \n",
" NaN | \n",
"
\n",
" \n",
"
\n",
"
181 rows × 3 columns
\n",
"
"
],
"text/plain": [
" code name noData\n",
"id \n",
"3 AUS Australia NaN\n",
"4 AUT Austria NaN\n",
"5 BEL Belgium NaN\n",
"9 CAN Canada NaN\n",
"10 CHE Switzerland NaN\n",
"... ... ... ...\n",
"100214 VNM Viet Nam NaN\n",
"100215 YEM Yemen NaN\n",
"100216 ZMB Zambia NaN\n",
"100217 ZWE Zimbabwe NaN\n",
"100229 PSE State of Palestine NaN\n",
"\n",
"[181 rows x 3 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# access metadata\n",
"r.parties"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:20.914740Z",
"iopub.status.busy": "2020-10-26T15:58:20.914521Z",
"iopub.status.idle": "2020-10-26T15:58:20.939364Z",
"shell.execute_reply": "2020-10-26T15:58:20.938404Z",
"shell.execute_reply.started": "2020-10-26T15:58:20.914720Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" name | \n",
"
\n",
" \n",
" id | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" 10466 | \n",
" Aggregate F-gases | \n",
"
\n",
" \n",
" 10467 | \n",
" Aggregate GHGs | \n",
"
\n",
" \n",
" 10468 | \n",
" CH₄ | \n",
"
\n",
" \n",
" 10469 | \n",
" CO₂ | \n",
"
\n",
" \n",
" 10470 | \n",
" HFCs | \n",
"
\n",
" \n",
" 10471 | \n",
" N₂O | \n",
"
\n",
" \n",
" 10472 | \n",
" NF₃ | \n",
"
\n",
" \n",
" 10473 | \n",
" PFCs | \n",
"
\n",
" \n",
" 10474 | \n",
" SF₆ | \n",
"
\n",
" \n",
" 10475 | \n",
" Unspecified mix of HFCs and PFCs | \n",
"
\n",
" \n",
" 10601 | \n",
" Unspecified mix of HFCs | \n",
"
\n",
" \n",
" 10602 | \n",
" Unspecified mix of PFCs | \n",
"
\n",
" \n",
" 10603 | \n",
" HFC-23 | \n",
"
\n",
" \n",
" 10604 | \n",
" HFC-32 | \n",
"
\n",
" \n",
" 10605 | \n",
" HFC-41 | \n",
"
\n",
" \n",
" 10606 | \n",
" HFC-43-10mee | \n",
"
\n",
" \n",
" 10607 | \n",
" HFC-125 | \n",
"
\n",
" \n",
" 10608 | \n",
" HFC-134 | \n",
"
\n",
" \n",
" 10609 | \n",
" HFC-134a | \n",
"
\n",
" \n",
" 10610 | \n",
" HFC-143 | \n",
"
\n",
" \n",
" 10611 | \n",
" HFC-143a | \n",
"
\n",
" \n",
" 10612 | \n",
" HFC-152 | \n",
"
\n",
" \n",
" 10613 | \n",
" HFC-152a | \n",
"
\n",
" \n",
" 10614 | \n",
" HFC-161 | \n",
"
\n",
" \n",
" 10615 | \n",
" HFC-227ea | \n",
"
\n",
" \n",
" 10616 | \n",
" HFC-236cb | \n",
"
\n",
" \n",
" 10617 | \n",
" HFC-236ea | \n",
"
\n",
" \n",
" 10618 | \n",
" HFC-236fa | \n",
"
\n",
" \n",
" 10619 | \n",
" HFC-245ca | \n",
"
\n",
" \n",
" 10620 | \n",
" HFC-245fa | \n",
"
\n",
" \n",
" 10621 | \n",
" HFC-365mfc | \n",
"
\n",
" \n",
" 10622 | \n",
" CF₄ | \n",
"
\n",
" \n",
" 10623 | \n",
" C₂F₆ | \n",
"
\n",
" \n",
" 10624 | \n",
" c-C₃F₆ | \n",
"
\n",
" \n",
" 10625 | \n",
" C₃F₈ | \n",
"
\n",
" \n",
" 10626 | \n",
" c-C₄F₈ | \n",
"
\n",
" \n",
" 10627 | \n",
" C₄F₁₀ | \n",
"
\n",
" \n",
" 10628 | \n",
" C5F₁₂ | \n",
"
\n",
" \n",
" 10629 | \n",
" C₆F₁₄ | \n",
"
\n",
" \n",
" 10630 | \n",
" C₁₀F₁₈ | \n",
"
\n",
" \n",
" 10631 | \n",
" C | \n",
"
\n",
" \n",
" 10632 | \n",
" CO | \n",
"
\n",
" \n",
" 10633 | \n",
" NH₃ | \n",
"
\n",
" \n",
" 10634 | \n",
" NMVOC | \n",
"
\n",
" \n",
" 10635 | \n",
" NOₓ | \n",
"
\n",
" \n",
" 10636 | \n",
" SO₂ | \n",
"
\n",
" \n",
" 10637 | \n",
" No gas | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" name\n",
"id \n",
"10466 Aggregate F-gases\n",
"10467 Aggregate GHGs\n",
"10468 CH₄\n",
"10469 CO₂\n",
"10470 HFCs\n",
"10471 N₂O\n",
"10472 NF₃\n",
"10473 PFCs\n",
"10474 SF₆\n",
"10475 Unspecified mix of HFCs and PFCs\n",
"10601 Unspecified mix of HFCs\n",
"10602 Unspecified mix of PFCs\n",
"10603 HFC-23\n",
"10604 HFC-32\n",
"10605 HFC-41\n",
"10606 HFC-43-10mee\n",
"10607 HFC-125\n",
"10608 HFC-134\n",
"10609 HFC-134a\n",
"10610 HFC-143\n",
"10611 HFC-143a\n",
"10612 HFC-152\n",
"10613 HFC-152a\n",
"10614 HFC-161\n",
"10615 HFC-227ea\n",
"10616 HFC-236cb\n",
"10617 HFC-236ea\n",
"10618 HFC-236fa\n",
"10619 HFC-245ca\n",
"10620 HFC-245fa\n",
"10621 HFC-365mfc\n",
"10622 CF₄\n",
"10623 C₂F₆\n",
"10624 c-C₃F₆\n",
"10625 C₃F₈\n",
"10626 c-C₄F₈\n",
"10627 C₄F₁₀\n",
"10628 C5F₁₂\n",
"10629 C₆F₁₄\n",
"10630 C₁₀F₁₈\n",
"10631 C\n",
"10632 CO\n",
"10633 NH₃\n",
"10634 NMVOC\n",
"10635 NOₓ\n",
"10636 SO₂\n",
"10637 No gas"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r.gases"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:23.953068Z",
"iopub.status.busy": "2020-10-26T15:58:23.951830Z",
"iopub.status.idle": "2020-10-26T15:58:23.997328Z",
"shell.execute_reply": "2020-10-26T15:58:23.996616Z",
"shell.execute_reply.started": "2020-10-26T15:58:23.952949Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m\n",
"\u001b[0mr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquery\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mparty_code\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mgases\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mprogress\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m\n",
"Query the UNFCCC for data.\n",
":param party_code: ISO codes of a party for which to query.\n",
" For possible values, see .parties .\n",
":param gases: list of gases to query for. For possible values, see .gases .\n",
" Default: query for all gases.\n",
":param progress: Display a progress bar. Requires tqdm.\n",
"\n",
"If you need more fine-grained control over which variables to query for, including restricting the query\n",
"to specific measures, categories, or classifications or to query for multiple parties at once, please see the\n",
"corresponding methods .annex_one_reader.query and .non_annex_one_reader.query .\n",
"\u001b[0;31mFile:\u001b[0m ~/work/read_di_unfccc/read_di_unfccc.py\n",
"\u001b[0;31mType:\u001b[0m method\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# for obtaining information from the database, use r.query()\n",
"r.query?"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:27.220658Z",
"iopub.status.busy": "2020-10-26T15:58:27.220350Z",
"iopub.status.idle": "2020-10-26T15:58:27.499426Z",
"shell.execute_reply": "2020-10-26T15:58:27.498700Z",
"shell.execute_reply.started": "2020-10-26T15:58:27.220631Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" index | \n",
" party | \n",
" category | \n",
" classification | \n",
" measure | \n",
" gas | \n",
" unit | \n",
" year | \n",
" numberValue | \n",
" stringValue | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 318 | \n",
" AFG | \n",
" 1. Energy | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" Aggregate GHGs | \n",
" Gg CO₂ equivalent | \n",
" 2005 | \n",
" 3776.15946 | \n",
" None | \n",
"
\n",
" \n",
" 1 | \n",
" 374 | \n",
" AFG | \n",
" 1. Energy | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" Aggregate GHGs | \n",
" Gg CO₂ equivalent | \n",
" 2013 | \n",
" 10281.00000 | \n",
" None | \n",
"
\n",
" \n",
" 2 | \n",
" 87 | \n",
" AFG | \n",
" 1. Energy | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CH₄ | \n",
" Gg | \n",
" 2005 | \n",
" 35.06076 | \n",
" None | \n",
"
\n",
" \n",
" 3 | \n",
" 173 | \n",
" AFG | \n",
" 1. Energy | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CH₄ | \n",
" Gg | \n",
" 2013 | \n",
" 4.00000 | \n",
" None | \n",
"
\n",
" \n",
" 4 | \n",
" 4 | \n",
" AFG | \n",
" 1. Energy | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO | \n",
" Gg | \n",
" 2005 | \n",
" 865.20000 | \n",
" None | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 373 | \n",
" 242 | \n",
" AFG | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2014 | \n",
" 26556.75400 | \n",
" None | \n",
"
\n",
" \n",
" 374 | \n",
" 243 | \n",
" AFG | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2015 | \n",
" 27101.36500 | \n",
" None | \n",
"
\n",
" \n",
" 375 | \n",
" 244 | \n",
" AFG | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2016 | \n",
" 27657.14500 | \n",
" None | \n",
"
\n",
" \n",
" 376 | \n",
" 245 | \n",
" AFG | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2017 | \n",
" 28224.32300 | \n",
" None | \n",
"
\n",
" \n",
" 377 | \n",
" 246 | \n",
" AFG | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2018 | \n",
" 30075.01800 | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
378 rows × 10 columns
\n",
"
"
],
"text/plain": [
" index party category classification \\\n",
"0 318 AFG 1. Energy Total for category \n",
"1 374 AFG 1. Energy Total for category \n",
"2 87 AFG 1. Energy Total for category \n",
"3 173 AFG 1. Energy Total for category \n",
"4 4 AFG 1. Energy Total for category \n",
".. ... ... ... ... \n",
"373 242 AFG unknown category nr. 10504 Total for category \n",
"374 243 AFG unknown category nr. 10504 Total for category \n",
"375 244 AFG unknown category nr. 10504 Total for category \n",
"376 245 AFG unknown category nr. 10504 Total for category \n",
"377 246 AFG unknown category nr. 10504 Total for category \n",
"\n",
" measure gas unit year \\\n",
"0 Net emissions/removals Aggregate GHGs Gg CO₂ equivalent 2005 \n",
"1 Net emissions/removals Aggregate GHGs Gg CO₂ equivalent 2013 \n",
"2 Net emissions/removals CH₄ Gg 2005 \n",
"3 Net emissions/removals CH₄ Gg 2013 \n",
"4 Net emissions/removals CO Gg 2005 \n",
".. ... ... ... ... \n",
"373 Total population No gas thousands 2014 \n",
"374 Total population No gas thousands 2015 \n",
"375 Total population No gas thousands 2016 \n",
"376 Total population No gas thousands 2017 \n",
"377 Total population No gas thousands 2018 \n",
"\n",
" numberValue stringValue \n",
"0 3776.15946 None \n",
"1 10281.00000 None \n",
"2 35.06076 None \n",
"3 4.00000 None \n",
"4 865.20000 None \n",
".. ... ... \n",
"373 26556.75400 None \n",
"374 27101.36500 None \n",
"375 27657.14500 None \n",
"376 28224.32300 None \n",
"377 30075.01800 None \n",
"\n",
"[378 rows x 10 columns]"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Note that only the \"party_code\" parameter is mandatory, gases can be left empty to query for all gases\n",
"r.query(party_code='AFG')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:36.420713Z",
"iopub.status.busy": "2020-10-26T15:58:36.419812Z",
"iopub.status.idle": "2020-10-26T15:58:36.429468Z",
"shell.execute_reply": "2020-10-26T15:58:36.426555Z",
"shell.execute_reply.started": "2020-10-26T15:58:36.420633Z"
}
},
"outputs": [],
"source": [
"# the result is returned in a pandas DataFrame. Note that sometimes, unknown categories are returned (ex. \"unkown category nr. 10503\") and\n",
"# data points can have a numberValue and/or a stringValue such as \"NO\", \"NE\", or \"C\""
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:37.723351Z",
"iopub.status.busy": "2020-10-26T15:58:37.722994Z",
"iopub.status.idle": "2020-10-26T15:58:43.374602Z",
"shell.execute_reply": "2020-10-26T15:58:43.373887Z",
"shell.execute_reply.started": "2020-10-26T15:58:37.723292Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" index | \n",
" party | \n",
" category | \n",
" classification | \n",
" measure | \n",
" gas | \n",
" unit | \n",
" year | \n",
" numberValue | \n",
" stringValue | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 63671 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" CH₄ | \n",
" no unit | \n",
" 1990 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 1 | \n",
" 63672 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" CH₄ | \n",
" no unit | \n",
" 1991 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 2 | \n",
" 63673 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" CH₄ | \n",
" no unit | \n",
" 1992 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 3 | \n",
" 63674 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" CH₄ | \n",
" no unit | \n",
" 1993 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 4 | \n",
" 63675 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" CH₄ | \n",
" no unit | \n",
" 1994 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 309607 | \n",
" 50136 | \n",
" DEU | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2015 | \n",
" 81686.6630 | \n",
" None | \n",
"
\n",
" \n",
" 309608 | \n",
" 50137 | \n",
" DEU | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2016 | \n",
" 82348.6685 | \n",
" None | \n",
"
\n",
" \n",
" 309609 | \n",
" 50138 | \n",
" DEU | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2017 | \n",
" 82657.0020 | \n",
" None | \n",
"
\n",
" \n",
" 309610 | \n",
" 50139 | \n",
" DEU | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" 2018 | \n",
" 82792.3510 | \n",
" None | \n",
"
\n",
" \n",
" 309611 | \n",
" 50110 | \n",
" DEU | \n",
" unknown category nr. 10504 | \n",
" Total for category | \n",
" Total population | \n",
" No gas | \n",
" thousands | \n",
" Base year | \n",
" 79364.5040 | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
309612 rows × 10 columns
\n",
"
"
],
"text/plain": [
" index party category classification \\\n",
"0 63671 DEU 1. Energy Total for category \n",
"1 63672 DEU 1. Energy Total for category \n",
"2 63673 DEU 1. Energy Total for category \n",
"3 63674 DEU 1. Energy Total for category \n",
"4 63675 DEU 1. Energy Total for category \n",
"... ... ... ... ... \n",
"309607 50136 DEU unknown category nr. 10504 Total for category \n",
"309608 50137 DEU unknown category nr. 10504 Total for category \n",
"309609 50138 DEU unknown category nr. 10504 Total for category \n",
"309610 50139 DEU unknown category nr. 10504 Total for category \n",
"309611 50110 DEU unknown category nr. 10504 Total for category \n",
"\n",
" measure gas unit year \\\n",
"0 Emission factor information CH₄ no unit 1990 \n",
"1 Emission factor information CH₄ no unit 1991 \n",
"2 Emission factor information CH₄ no unit 1992 \n",
"3 Emission factor information CH₄ no unit 1993 \n",
"4 Emission factor information CH₄ no unit 1994 \n",
"... ... ... ... ... \n",
"309607 Total population No gas thousands 2015 \n",
"309608 Total population No gas thousands 2016 \n",
"309609 Total population No gas thousands 2017 \n",
"309610 Total population No gas thousands 2018 \n",
"309611 Total population No gas thousands Base year \n",
"\n",
" numberValue stringValue \n",
"0 NaN CS,D,M \n",
"1 NaN CS,D,M \n",
"2 NaN CS,D,M \n",
"3 NaN CS,D,M \n",
"4 NaN CS,D,M \n",
"... ... ... \n",
"309607 81686.6630 None \n",
"309608 82348.6685 None \n",
"309609 82657.0020 None \n",
"309610 82792.3510 None \n",
"309611 79364.5040 None \n",
"\n",
"[309612 rows x 10 columns]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Querying Annex-I parties for all gases leads to large queries which take a relatively long time to process\n",
"r.query(party_code='DEU')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:46.991742Z",
"iopub.status.busy": "2020-10-26T15:58:46.991467Z",
"iopub.status.idle": "2020-10-26T15:58:47.600445Z",
"shell.execute_reply": "2020-10-26T15:58:47.599838Z",
"shell.execute_reply.started": "2020-10-26T15:58:46.991719Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" index | \n",
" party | \n",
" category | \n",
" classification | \n",
" measure | \n",
" gas | \n",
" unit | \n",
" year | \n",
" numberValue | \n",
" stringValue | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 8131 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" N₂O | \n",
" no unit | \n",
" 1990 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 1 | \n",
" 8132 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" N₂O | \n",
" no unit | \n",
" 1991 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 2 | \n",
" 8133 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" N₂O | \n",
" no unit | \n",
" 1992 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 3 | \n",
" 8134 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" N₂O | \n",
" no unit | \n",
" 1993 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" 4 | \n",
" 8135 | \n",
" DEU | \n",
" 1. Energy | \n",
" Total for category | \n",
" Emission factor information | \n",
" N₂O | \n",
" no unit | \n",
" 1994 | \n",
" NaN | \n",
" CS,D,M | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 34168 | \n",
" 86 | \n",
" DEU | \n",
" Total GHG emissions without LULUCF | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" N₂O | \n",
" kt | \n",
" 2015 | \n",
" 129.755265 | \n",
" None | \n",
"
\n",
" \n",
" 34169 | \n",
" 87 | \n",
" DEU | \n",
" Total GHG emissions without LULUCF | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" N₂O | \n",
" kt | \n",
" 2016 | \n",
" 126.960736 | \n",
" None | \n",
"
\n",
" \n",
" 34170 | \n",
" 88 | \n",
" DEU | \n",
" Total GHG emissions without LULUCF | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" N₂O | \n",
" kt | \n",
" 2017 | \n",
" 125.976196 | \n",
" None | \n",
"
\n",
" \n",
" 34171 | \n",
" 89 | \n",
" DEU | \n",
" Total GHG emissions without LULUCF | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" N₂O | \n",
" kt | \n",
" 2018 | \n",
" 119.188881 | \n",
" None | \n",
"
\n",
" \n",
" 34172 | \n",
" 60 | \n",
" DEU | \n",
" Total GHG emissions without LULUCF | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" N₂O | \n",
" kt | \n",
" Base year | \n",
" 209.808203 | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
34173 rows × 10 columns
\n",
"
"
],
"text/plain": [
" index party category classification \\\n",
"0 8131 DEU 1. Energy Total for category \n",
"1 8132 DEU 1. Energy Total for category \n",
"2 8133 DEU 1. Energy Total for category \n",
"3 8134 DEU 1. Energy Total for category \n",
"4 8135 DEU 1. Energy Total for category \n",
"... ... ... ... ... \n",
"34168 86 DEU Total GHG emissions without LULUCF Total for category \n",
"34169 87 DEU Total GHG emissions without LULUCF Total for category \n",
"34170 88 DEU Total GHG emissions without LULUCF Total for category \n",
"34171 89 DEU Total GHG emissions without LULUCF Total for category \n",
"34172 60 DEU Total GHG emissions without LULUCF Total for category \n",
"\n",
" measure gas unit year numberValue \\\n",
"0 Emission factor information N₂O no unit 1990 NaN \n",
"1 Emission factor information N₂O no unit 1991 NaN \n",
"2 Emission factor information N₂O no unit 1992 NaN \n",
"3 Emission factor information N₂O no unit 1993 NaN \n",
"4 Emission factor information N₂O no unit 1994 NaN \n",
"... ... ... ... ... ... \n",
"34168 Net emissions/removals N₂O kt 2015 129.755265 \n",
"34169 Net emissions/removals N₂O kt 2016 126.960736 \n",
"34170 Net emissions/removals N₂O kt 2017 125.976196 \n",
"34171 Net emissions/removals N₂O kt 2018 119.188881 \n",
"34172 Net emissions/removals N₂O kt Base year 209.808203 \n",
"\n",
" stringValue \n",
"0 CS,D,M \n",
"1 CS,D,M \n",
"2 CS,D,M \n",
"3 CS,D,M \n",
"4 CS,D,M \n",
"... ... \n",
"34168 None \n",
"34169 None \n",
"34170 None \n",
"34171 None \n",
"34172 None \n",
"\n",
"[34173 rows x 10 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# If you don't need all the information, it is beneficial to query for single gases only\n",
"# or use the more specialized query interface (see below)\n",
"r.query(party_code='DEU', gases=['N₂O'])"
]
},
{
"cell_type": "markdown",
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-19T11:44:16.200695Z",
"iopub.status.busy": "2020-10-19T11:44:16.200515Z",
"iopub.status.idle": "2020-10-19T11:44:18.105950Z",
"shell.execute_reply": "2020-10-19T11:44:18.105407Z",
"shell.execute_reply.started": "2020-10-19T11:44:16.200680Z"
}
},
"source": [
"## Using the specialized query interfaces for finer control"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:49.672812Z",
"iopub.status.busy": "2020-10-26T15:58:49.671961Z",
"iopub.status.idle": "2020-10-26T15:58:49.685226Z",
"shell.execute_reply": "2020-10-26T15:58:49.683771Z",
"shell.execute_reply.started": "2020-10-26T15:58:49.672732Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# API objects for annexOne and nonAnnexOne parties are available\n",
"r.annex_one_reader\n",
"r.non_annex_one_reader"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:50.087993Z",
"iopub.status.busy": "2020-10-26T15:58:50.087685Z",
"iopub.status.idle": "2020-10-26T15:58:50.098245Z",
"shell.execute_reply": "2020-10-26T15:58:50.097549Z",
"shell.execute_reply.started": "2020-10-26T15:58:50.087954Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" code | \n",
" name | \n",
"
\n",
" \n",
" id | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" 3 | \n",
" AUS | \n",
" Australia | \n",
"
\n",
" \n",
" 4 | \n",
" AUT | \n",
" Austria | \n",
"
\n",
" \n",
" 5 | \n",
" BEL | \n",
" Belgium | \n",
"
\n",
" \n",
" 9 | \n",
" CAN | \n",
" Canada | \n",
"
\n",
" \n",
" 10 | \n",
" CHE | \n",
" Switzerland | \n",
"
\n",
" \n",
" 11 | \n",
" CYP | \n",
" Cyprus | \n",
"
\n",
" \n",
" 13 | \n",
" DEU | \n",
" Germany | \n",
"
\n",
" \n",
" 15 | \n",
" DNK | \n",
" Denmark | \n",
"
\n",
" \n",
" 17 | \n",
" ESP | \n",
" Spain | \n",
"
\n",
" \n",
" 21 | \n",
" FIN | \n",
" Finland | \n",
"
\n",
" \n",
" 23 | \n",
" FRA | \n",
" France | \n",
"
\n",
" \n",
" 27 | \n",
" GBR | \n",
" United Kingdom of Great Britain and Northern I... | \n",
"
\n",
" \n",
" 28 | \n",
" GRC | \n",
" Greece | \n",
"
\n",
" \n",
" 32 | \n",
" IRL | \n",
" Ireland | \n",
"
\n",
" \n",
" 33 | \n",
" ISL | \n",
" Iceland | \n",
"
\n",
" \n",
" 34 | \n",
" ITA | \n",
" Italy | \n",
"
\n",
" \n",
" 35 | \n",
" JPN | \n",
" Japan | \n",
"
\n",
" \n",
" 38 | \n",
" LIE | \n",
" Liechtenstein | \n",
"
\n",
" \n",
" 40 | \n",
" LUX | \n",
" Luxembourg | \n",
"
\n",
" \n",
" 42 | \n",
" MCO | \n",
" Monaco | \n",
"
\n",
" \n",
" 43 | \n",
" MLT | \n",
" Malta | \n",
"
\n",
" \n",
" 44 | \n",
" NLD | \n",
" Netherlands | \n",
"
\n",
" \n",
" 45 | \n",
" NOR | \n",
" Norway | \n",
"
\n",
" \n",
" 46 | \n",
" NZL | \n",
" New Zealand | \n",
"
\n",
" \n",
" 48 | \n",
" PRT | \n",
" Portugal | \n",
"
\n",
" \n",
" 53 | \n",
" SWE | \n",
" Sweden | \n",
"
\n",
" \n",
" 54 | \n",
" TUR | \n",
" Turkey | \n",
"
\n",
" \n",
" 56 | \n",
" USA | \n",
" United States of America | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" code name\n",
"id \n",
"3 AUS Australia\n",
"4 AUT Austria\n",
"5 BEL Belgium\n",
"9 CAN Canada\n",
"10 CHE Switzerland\n",
"11 CYP Cyprus\n",
"13 DEU Germany\n",
"15 DNK Denmark\n",
"17 ESP Spain\n",
"21 FIN Finland\n",
"23 FRA France\n",
"27 GBR United Kingdom of Great Britain and Northern I...\n",
"28 GRC Greece\n",
"32 IRL Ireland\n",
"33 ISL Iceland\n",
"34 ITA Italy\n",
"35 JPN Japan\n",
"38 LIE Liechtenstein\n",
"40 LUX Luxembourg\n",
"42 MCO Monaco\n",
"43 MLT Malta\n",
"44 NLD Netherlands\n",
"45 NOR Norway\n",
"46 NZL New Zealand\n",
"48 PRT Portugal\n",
"53 SWE Sweden\n",
"54 TUR Turkey\n",
"56 USA United States of America"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# access metadata\n",
"r.annex_one_reader.parties"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:51.501871Z",
"iopub.status.busy": "2020-10-26T15:58:51.501027Z",
"iopub.status.idle": "2020-10-26T15:58:51.510785Z",
"shell.execute_reply": "2020-10-26T15:58:51.508488Z",
"shell.execute_reply.started": "2020-10-26T15:58:51.501790Z"
}
},
"outputs": [],
"source": [
"# other available metadata\n",
"#r.annex_one_reader.years\n",
"#r.annex_one_reader.classifications\n",
"#r.annex_one_reader.gases\n",
"#r.annex_one_reader.units\n",
"#r.annex_one_reader.conversion_factors"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:52.277140Z",
"iopub.status.busy": "2020-10-26T15:58:52.276575Z",
"iopub.status.idle": "2020-10-26T15:58:52.294297Z",
"shell.execute_reply": "2020-10-26T15:58:52.293364Z",
"shell.execute_reply.started": "2020-10-26T15:58:52.277089Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Totals[10465]\n",
"├── Total GHG emissions with LULUCF[8677]\n",
"│ ├── 1. Energy[8819]\n",
"│ │ ├── 1.AA Fuel Combustion - Sectoral approach[9089]\n",
"│ │ │ ├── 1.A.1 Energy Industries[10402]\n",
"│ │ │ │ ├── 1.A.1.a Public Electricity and Heat Production[9422]\n",
"│ │ │ │ │ ├── 1.A.1.a.i Electricity Generation[8616]\n",
"│ │ │ │ │ ├── 1.A.1.a.ii Combined Heat and Power Generation[9614]\n",
"│ │ │ │ │ ├── 1.A.1.a.iii Heat Plants[9971]\n",
"│ │ │ │ │ └── 1.A.1.a.iv Other[8368]\n",
"│ │ │ │ ├── 1.A.1.b Petroleum Refining[9771]\n",
"│ │ │ │ └── 1.A.1.c Manufacture of Solid Fuels and Other Energy Industries[9004]\n",
"│ │ │ │ ├── 1.A.1.c.i Manufacture of Solid Fuels[10306]\n",
"│ │ │ │ ├── 1.A.1.c.ii Oil and Gas Extraction[10425]\n",
"│ │ │ │ ├── 1.A.1.c.iii Other Energy Industries[8335]\n",
"│ │ │ │ └── 1.A.1.c.iv Other[8656]\n",
"│ │ │ ├── 1.A.2 Manufacturing Industries and Construction[8556]\n",
"│ │ │ │ ├── 1.A.2.a Iron and Steel[10329]\n",
"│ │ │ │ ├── 1.A.2.b Non-Ferrous Metals[9859]\n",
"│ │ │ │ ├── 1.A.2.c Chemicals[9369]\n",
"│ │ │ │ ├── 1.A.2.d Pulp, Paper and Print[10119]\n",
"│ │ │ │ ├── 1.A.2.e Food Processing, Beverages and Tobacco[8321]\n",
"│ │ │ │ ├── 1.A.2.f Non-metallic Minerals[8876]\n",
"│ │ │ │ └── 1.A.2.g Other[9832]\n",
"│ │ │ │ ├── 1.A.2.g.i Manufacturing of Machinery[10308]\n",
"│ │ │ │ ├── 1.A.2.g.ii Manufacturing of Transport Equipment[10150]\n",
"│ │ │ │ ├── 1.A.2.g.iii Mining (Excluding Fuels) and Quarrying[8527]\n",
"│ │ │ │ ├── 1.A.2.g.iv Wood and Wood Products[8424]\n",
"│ │ │ │ ├── 1.A.2.g.v Construction[10287]\n",
"│ │ │ │ ├── 1.A.2.g.vi Textile and Leather[8721]\n",
"│ │ │ │ ├── 1.A.2.g.vii Off-road Vehicles and Other Machinery[8587]\n",
"│ │ │ │ └── 1.A.2.g.viii Other[8794]\n",
"│ │ │ ├── 1.A.3 Transport[8322]\n",
"│ │ │ │ ├── 1.A.3.a Domestic Aviation[10419]\n",
"│ │ │ │ ├── 1.A.3.b Road Transportation[9607]\n",
"│ │ │ │ │ ├── 1.A.3.b.i Cars[9279]\n",
"│ │ │ │ │ ├── 1.A.3.b.ii Light Duty Trucks[9702]\n",
"│ │ │ │ │ ├── 1.A.3.b.iii Heavy Duty Trucks and Buses[8358]\n",
"│ │ │ │ │ ├── 1.A.3.b.iv Motorcycles[9622]\n",
"│ │ │ │ │ └── 1.A.3.b.v Other[9083]\n",
"│ │ │ │ ├── 1.A.3.c Railways[8924]\n",
"│ │ │ │ ├── 1.A.3.d Domestic Navigation[9670]\n",
"│ │ │ │ └── 1.A.3.e Other Transportation[8456]\n",
"│ │ │ │ ├── 1.A.3.e.i Pipeline Transport[9504]\n",
"│ │ │ │ └── 1.A.3.e.ii Other[9935]\n",
"│ │ │ ├── 1.A.4 Other Sectors[9815]\n",
"│ │ │ │ ├── 1.A.4.a Commercial/Institutional[8597]\n",
"│ │ │ │ │ ├── 1.A.4.a.i Stationary Combustion[8216]\n",
"│ │ │ │ │ ├── 1.A.4.a.ii Off-road Vehicles and Other Machinery[8251]\n",
"│ │ │ │ │ └── 1.A.4.a.iii Other[8223]\n",
"│ │ │ │ ├── 1.A.4.b Residential[9823]\n",
"│ │ │ │ │ ├── 1.A.4.b.i Stationary Combustion[8609]\n",
"│ │ │ │ │ ├── 1.A.4.b.ii Off-road Vehicles and Other Machinery[10435]\n",
"│ │ │ │ │ └── 1.A.4.b.iii Other[8632]\n",
"│ │ │ │ └── 1.A.4.c Agriculture/Forestry/Fishing[8554]\n",
"│ │ │ │ ├── 1.A.4.c.i Stationary[8364]\n",
"│ │ │ │ ├── 1.A.4.c.ii Off-road Vehicles and Other Machinery[10080]\n",
"│ │ │ │ └── 1.A.4.c.iii Fishing[9812]\n",
"│ │ │ ├── 1.A.5 Other (Not specified elsewhere)[10273]\n",
"│ │ │ │ ├── 1.A.5.a Stationary[9861]\n",
"│ │ │ │ └── 1.A.5.b Mobile[9101]\n",
"│ │ │ └── Information Item[11026]\n",
"│ │ │ ├── Waste Incineration with Energy Recovery included as Biomass[11027]\n",
"│ │ │ └── Waste Incineration with Energy Recovery included as Fossil Fuels[11028]\n",
"│ │ ├── 1.AB Fuel Combustion - Reference Approach[8533]\n",
"│ │ ├── 1.AD Feedstocks, Reductants and Other Non-energy Use of Fuels[8731]\n",
"│ │ ├── 1.B Fugitive Emissions from Fuels[9374]\n",
"│ │ │ ├── 1.B.1 Solid Fuels[9455]\n",
"│ │ │ │ ├── 1.B.1.a Coal Mining and Handling[9835]\n",
"│ │ │ │ │ ├── 1.B.1.a.i Underground Mines[9116]\n",
"│ │ │ │ │ │ ├── 1.B.1.a.i.1 Mining Activities[9933]\n",
"│ │ │ │ │ │ ├── 1.B.1.a.i.2 Post-Mining Activities[9427]\n",
"│ │ │ │ │ │ └── 1.B.1.a.i.3 Abandoned Underground Mines[8211]\n",
"│ │ │ │ │ └── 1.B.1.a.ii Surface Mines[8573]\n",
"│ │ │ │ │ ├── 1.B.1.a.ii.1 Mining Activities[10282]\n",
"│ │ │ │ │ └── 1.B.1.a.ii.2 Post-Mining Activities[9601]\n",
"│ │ │ │ ├── 1.B.1.b Solid Fuel Transformation[8300]\n",
"│ │ │ │ └── 1.B.1.c Other[8964]\n",
"│ │ │ └── 1.B.2 Oil and Natural Gas and Other Emissions from Energy Production[8806]\n",
"│ │ │ ├── 1.B.2.a Oil[9822]\n",
"│ │ │ │ ├── 1.B.2.a.i Exploration[8165]\n",
"│ │ │ │ ├── 1.B.2.a.ii Production[10078]\n",
"│ │ │ │ ├── 1.B.2.a.iii Transport[9550]\n",
"│ │ │ │ ├── 1.B.2.a.iv Refining / Storage[9891]\n",
"│ │ │ │ ├── 1.B.2.a.v Distribution of Oil Products[8371]\n",
"│ │ │ │ └── 1.B.2.a.vi Other[8228]\n",
"│ │ │ ├── 1.B.2.b Natural Gas[8493]\n",
"│ │ │ │ ├── 1.B.2.b.i Exploration[9314]\n",
"│ │ │ │ ├── 1.B.2.b.ii Production[8474]\n",
"│ │ │ │ ├── 1.B.2.b.iii Processing[9999]\n",
"│ │ │ │ ├── 1.B.2.b.iv Transmission and Storage[9902]\n",
"│ │ │ │ ├── 1.B.2.b.v Distribution[9728]\n",
"│ │ │ │ └── 1.B.2.b.vi Other[9974]\n",
"│ │ │ ├── 1.B.2.c Venting and Flaring[8333]\n",
"│ │ │ │ ├── 1.B.2.c.i Venting[10303]\n",
"│ │ │ │ │ ├── 1.B.2.c.i.1 Oil[9827]\n",
"│ │ │ │ │ ├── 1.B.2.c.i.2 Gas[10239]\n",
"│ │ │ │ │ └── 1.B.2.c.i.3 Combined[8576]\n",
"│ │ │ │ └── 1.B.2.c.ii Flaring[10392]\n",
"│ │ │ │ ├── 1.B.2.c.ii.1 Oil[9210]\n",
"│ │ │ │ ├── 1.B.2.c.ii.2 Gas[8904]\n",
"│ │ │ │ └── 1.B.2.c.ii.3 Combined[9824]\n",
"│ │ │ └── 1.B.2.d Other[9077]\n",
"│ │ ├── 1.C CO₂ Transport and Storage[9070]\n",
"│ │ │ ├── 1.C.1 Transport of CO₂[9365]\n",
"│ │ │ │ ├── 1.C.1.a Pipelines[9769]\n",
"│ │ │ │ ├── 1.C.1.b Ships[10197]\n",
"│ │ │ │ └── 1.C.1.c Other[9366]\n",
"│ │ │ ├── 1.C.2 Injection and Storage[9474]\n",
"│ │ │ │ ├── 1.C.2.a Injection[8741]\n",
"│ │ │ │ └── 1.C.2.b Storage[10333]\n",
"│ │ │ ├── 1.C.3 Other[9330]\n",
"│ │ │ └── Information Item[11029]\n",
"│ │ │ ├── Total Amount Captured for Storage[11030]\n",
"│ │ │ ├── Total Amount of CO₂ Injected at Storage Sites[11033]\n",
"│ │ │ ├── Total Amount of Exports for Storage[11032]\n",
"│ │ │ ├── Total Amount of Imports for Storage[11031]\n",
"│ │ │ └── Total Leakage from Transport, Injection and Storage[11034]\n",
"│ │ └── Memo Items[8869]\n",
"│ │ ├── CO₂ Emissions from Biomass[8270]\n",
"│ │ ├── International Bunkers[8564]\n",
"│ │ │ ├── International Aviation[10357]\n",
"│ │ │ └── International Navigation[8828]\n",
"│ │ └── Multilateral Operations[8987]\n",
"│ ├── 2. Industrial Processes and Product Use[10393]\n",
"│ │ ├── 2.A Mineral Industry[8452]\n",
"│ │ │ ├── 2.A.1 Cement Production[8787]\n",
"│ │ │ ├── 2.A.2 Lime Production[8702]\n",
"│ │ │ ├── 2.A.3 Glass production[8579]\n",
"│ │ │ └── 2.A.4 Other Process Uses of Carbonates[9731]\n",
"│ │ │ ├── 2.A.4.a Ceramics[8539]\n",
"│ │ │ ├── 2.A.4.b Other Uses of Soda Ash[9452]\n",
"│ │ │ ├── 2.A.4.c Non-metallurgical Magnesium Production[10101]\n",
"│ │ │ └── 2.A.4.d Other[9342]\n",
"│ │ ├── 2.B Chemical Industry[9304]\n",
"│ │ │ ├── 2.B.1 Ammonia Production[9658]\n",
"│ │ │ ├── 2.B.10 Other[9953]\n",
"│ │ │ ├── 2.B.2 Nitric Acid Production[9410]\n",
"│ │ │ ├── 2.B.3 Adipic Acid Production[8468]\n",
"│ │ │ ├── 2.B.4 Caprolactam, Glyoxal and Glyoxylic Acid Production[8544]\n",
"│ │ │ │ ├── 2.B.4.a Caprolactam[9515]\n",
"│ │ │ │ ├── 2.B.4.b Glyoxal[9564]\n",
"│ │ │ │ └── 2.B.4.c Glyoxylic Acid[8789]\n",
"│ │ │ ├── 2.B.5 Carbide Production[9531]\n",
"│ │ │ │ ├── 2.B.5.a Silicon Carbide[9683]\n",
"│ │ │ │ └── 2.B.5.b Calcium Carbide[9206]\n",
"│ │ │ ├── 2.B.6 Titanium Dioxide Production[9917]\n",
"│ │ │ ├── 2.B.7 Soda Ash Production[8530]\n",
"│ │ │ ├── 2.B.8 Petrochemical and Carbon Black Production[9000]\n",
"│ │ │ │ ├── 2.B.8.a Methanol[8934]\n",
"│ │ │ │ ├── 2.B.8.b Ethylene[9146]\n",
"│ │ │ │ ├── 2.B.8.c Ethylene Dichloride and Vinyl Chloride Monomer[8686]\n",
"│ │ │ │ ├── 2.B.8.d Ethylene Oxide[9468]\n",
"│ │ │ │ ├── 2.B.8.e Acrylonitrile[9784]\n",
"│ │ │ │ ├── 2.B.8.f Carbon Black[8864]\n",
"│ │ │ │ └── 2.B.8.g Other[9384]\n",
"│ │ │ │ ├── 2.B.8.g.i Styrene[9941]\n",
"│ │ │ │ └── 2.B.8.g.ii Other[8276]\n",
"│ │ │ └── 2.B.9 Fluorochemical Production[8884]\n",
"│ │ │ ├── 2.B.9.a By-Product Emissions[9517]\n",
"│ │ │ │ ├── 2.B.9.a.i Production of HCFC-22[9992]\n",
"│ │ │ │ └── 2.B.9.a.ii Other[8782]\n",
"│ │ │ └── 2.B.9.b Fugitive Emissions[9938]\n",
"│ │ │ ├── 2.B.9.b.i Production of HFC-134a[8427]\n",
"│ │ │ ├── 2.B.9.b.ii Production of SF₆[8150]\n",
"│ │ │ └── 2.B.9.b.iii Other[8419]\n",
"│ │ ├── 2.C Metal Industry[9064]\n",
"│ │ │ ├── 2.C.1 Iron and Steel Production[8229]\n",
"│ │ │ │ ├── 2.C.1.a Steel[9540]\n",
"│ │ │ │ ├── 2.C.1.b Pig Iron[9567]\n",
"│ │ │ │ ├── 2.C.1.c Direct Reduced Iron[9679]\n",
"│ │ │ │ ├── 2.C.1.d Sinter[8962]\n",
"│ │ │ │ ├── 2.C.1.e Pellet[9387]\n",
"│ │ │ │ └── 2.C.1.f Other[10223]\n",
"│ │ │ ├── 2.C.2 Ferroalloys Production[10390]\n",
"│ │ │ ├── 2.C.3 Aluminium Production[10068]\n",
"│ │ │ │ ├── 2.C.3.a CO₂ Emissions[9079]\n",
"│ │ │ │ ├── 2.C.3.b By-Product Emissions[9445]\n",
"│ │ │ │ └── 2.C.3.c F-gases Used in Foundries[9072]\n",
"│ │ │ ├── 2.C.4 Magnesium Production[9635]\n",
"│ │ │ ├── 2.C.5 Lead Production[10210]\n",
"│ │ │ ├── 2.C.6 Zinc Production[9667]\n",
"│ │ │ └── 2.C.7 Other[10447]\n",
"│ │ ├── 2.D Non-energy Products from Fuels and Solvent Use[10094]\n",
"│ │ │ ├── 2.D.1 Lubricant Use[8852]\n",
"│ │ │ ├── 2.D.2 Paraffin Wax Use[8925]\n",
"│ │ │ └── 2.D.3 Other[8811]\n",
"│ │ │ ├── 2.D.3.a Solvent Use[10214]\n",
"│ │ │ ├── 2.D.3.b Road Paving with Asphalt[10044]\n",
"│ │ │ ├── 2.D.3.c Asphalt Roofing[8822]\n",
"│ │ │ └── 2.D.3.d Other[8212]\n",
"│ │ ├── 2.E Electronics Industry[8938]\n",
"│ │ │ ├── 2.E.1 Integrated Circuit or Semiconductor[10075]\n",
"│ │ │ ├── 2.E.2 TFT Flat Panel Display[10442]\n",
"│ │ │ ├── 2.E.3 Photovoltaics[8601]\n",
"│ │ │ ├── 2.E.4 Heat Transfer Fluid[9911]\n",
"│ │ │ └── 2.E.5 Other[8434]\n",
"│ │ ├── 2.F Product Uses as Substitutes for ODS[8262]\n",
"│ │ │ ├── 2.F.1 Refrigeration and Air-conditioning[9207]\n",
"│ │ │ │ ├── 2.F.1.a Commercial Refrigeration[9129]\n",
"│ │ │ │ ├── 2.F.1.b Domestic Refrigeration[9780]\n",
"│ │ │ │ ├── 2.F.1.c Industrial Refrigeration[10252]\n",
"│ │ │ │ ├── 2.F.1.d Transport Refrigeration[9634]\n",
"│ │ │ │ ├── 2.F.1.e Mobile Air-conditioning[10244]\n",
"│ │ │ │ └── 2.F.1.f Stationary Air-conditioning[10298]\n",
"│ │ │ ├── 2.F.2 Foam Blowing Agents[9352]\n",
"│ │ │ │ ├── 2.F.2.a Closed Cells[8642]\n",
"│ │ │ │ └── 2.F.2.b Open Cells[9224]\n",
"│ │ │ ├── 2.F.3 Fire Protection[9296]\n",
"│ │ │ ├── 2.F.4 Aerosols[10383]\n",
"│ │ │ │ ├── 2.F.4.a Metered Dose Inhalers[8519]\n",
"│ │ │ │ └── 2.F.4.b Other[8379]\n",
"│ │ │ ├── 2.F.5 Solvents[8316]\n",
"│ │ │ └── 2.F.6 Other Applications[8607]\n",
"│ │ │ ├── 2.F.6.a Emissive[10246]\n",
"│ │ │ └── 2.F.6.b Contained[10042]\n",
"│ │ ├── 2.G Other Product Manufacture and Use[8201]\n",
"│ │ │ ├── 2.G.1 Electrical Equipment[9490]\n",
"│ │ │ ├── 2.G.2 SF₆ and PFCs from Other Product Use[10301]\n",
"│ │ │ │ ├── 2.G.2.a Military Applications[9055]\n",
"│ │ │ │ ├── 2.G.2.b Accelerators[9925]\n",
"│ │ │ │ ├── 2.G.2.c Soundproof Windows[9789]\n",
"│ │ │ │ ├── 2.G.2.d Adiabatic Properties: Shoes and Tyres[9610]\n",
"│ │ │ │ └── 2.G.2.e Other[8978]\n",
"│ │ │ ├── 2.G.3 N₂O from Product Uses[10433]\n",
"│ │ │ │ ├── 2.G.3.a Medical Applications[8737]\n",
"│ │ │ │ └── 2.G.3.b Other[9014]\n",
"│ │ │ │ ├── 2.G.3.b.i Propellant for Pressure and Aerosol Products[9201]\n",
"│ │ │ │ └── 2.G.3.b.ii Other[8566]\n",
"│ │ │ └── 2.G.4 Other[8534]\n",
"│ │ └── 2.H Other[9899]\n",
"│ │ ├── 2.H.1 Pulp and Paper[8644]\n",
"│ │ ├── 2.H.2 Food and Beverages Industry[8797]\n",
"│ │ └── 2.H.3 Other[8883]\n",
"│ ├── 3. Agriculture[10096]\n",
"│ │ ├── 3.A Enteric Fermentation[9559]\n",
"│ │ ├── 3.B Manure Management[9608]\n",
"│ │ ├── 3.C Rice Cultivation[10228]\n",
"│ │ │ ├── 3.C.1 Irrigated[9960]\n",
"│ │ │ │ ├── 3.C.1.a Continuously Flooded[10315]\n",
"│ │ │ │ └── 3.C.1.b Intermittently Flooded[8915]\n",
"│ │ │ │ ├── 3.C.1.b.i Single Aeration[9184]\n",
"│ │ │ │ └── 3.C.1.b.ii Multiple Aeration[10065]\n",
"│ │ │ ├── 3.C.2 Rainfed[8984]\n",
"│ │ │ │ ├── 3.C.2.a Flood Prone[9942]\n",
"│ │ │ │ └── 3.C.2.b Drought Prone[8941]\n",
"│ │ │ ├── 3.C.3 Deep Water[9094]\n",
"│ │ │ │ ├── 3.C.3.a Water Depth 50-100 cm[8995]\n",
"│ │ │ │ └── 3.C.3.b Water Depth > 100 cm[8373]\n",
"│ │ │ └── 3.C.4 Other[8747]\n",
"│ │ ├── 3.D Agricultural Soils[9678]\n",
"│ │ │ ├── 3.D.1 Direct N₂O Emissions From Managed Soils[9087]\n",
"│ │ │ │ ├── 3.D.1.a Inorganic N Fertilizers[9566]\n",
"│ │ │ │ ├── 3.D.1.b Organic N Fertilizers[9523]\n",
"│ │ │ │ │ ├── 3.D.1.b.i Animal Manure Applied to Soils[8365]\n",
"│ │ │ │ │ ├── 3.D.1.b.ii Sewage Sludge Applied to Soils[8482]\n",
"│ │ │ │ │ └── 3.D.1.b.iii Other Organic Fertilizers Applied to Soils[8218]\n",
"│ │ │ │ ├── 3.D.1.c Urine and Dung Deposited by Grazing Animals[9041]\n",
"│ │ │ │ ├── 3.D.1.d Crop Residues[10142]\n",
"│ │ │ │ ├── 3.D.1.e Mineralization/Immobilization Associated with Loss/Gain of Soil Organic Matter[9302]\n",
"│ │ │ │ ├── 3.D.1.f Cultivation of Organic Soils[10437]\n",
"│ │ │ │ └── 3.D.1.g Other[8502]\n",
"│ │ │ └── 3.D.2 Indirect N₂O Emissions From Managed Soils[8920]\n",
"│ │ │ ├── 3.D.2.a Atmospheric Deposition[9821]\n",
"│ │ │ └── 3.D.2.b Nitrogen Leaching and Run-off[9875]\n",
"│ │ ├── 3.E Prescribed Burning of Savannas[10322]\n",
"│ │ │ ├── 3.E.1 Forest Land[9488]\n",
"│ │ │ └── 3.E.2 Grassland[9970]\n",
"│ │ ├── 3.F Field Burning of Agricultural Residues[8783]\n",
"│ │ │ ├── 3.F.1 Cereals[10305]\n",
"│ │ │ │ ├── 3.F.1.a Wheat[8669]\n",
"│ │ │ │ ├── 3.F.1.b Barley[10193]\n",
"│ │ │ │ ├── 3.F.1.c Maize[8990]\n",
"│ │ │ │ └── 3.F.1.d Other[9507]\n",
"│ │ │ ├── 3.F.2 Pulses[9749]\n",
"│ │ │ ├── 3.F.3 Tubers and Roots[9142]\n",
"│ │ │ ├── 3.F.4 Sugar Cane[10387]\n",
"│ │ │ └── 3.F.5 Other[10336]\n",
"│ │ ├── 3.G Liming[8278]\n",
"│ │ │ ├── 3.G.1 Limestone CaCO₃[8504]\n",
"│ │ │ └── 3.G.2 Dolomite CaMg(CO₃)₂[8267]\n",
"│ │ ├── 3.H Urea Application[9927]\n",
"│ │ ├── 3.I Other Carbon-containing Fertilizers[8417]\n",
"│ │ └── 3.J Other[10025]\n",
"│ ├── 4. Land Use, Land-Use Change and Forestry[9411]\n",
"│ │ ├── 4.A Forest Land[10121]\n",
"│ │ │ ├── 4.A.1 Forest Land Remaining Forest Land[8348]\n",
"│ │ │ └── 4.A.2 Land Converted to Forest Land[8416]\n",
"│ │ │ ├── 4.A.2.a Cropland Converted to Forest Land[9741]\n",
"│ │ │ ├── 4.A.2.b Grassland Converted to Forest Land[9851]\n",
"│ │ │ ├── 4.A.2.c Wetlands Converted to Forest Land[9306]\n",
"│ │ │ ├── 4.A.2.d Settlements Converted to Forest Land[10297]\n",
"│ │ │ └── 4.A.2.e Other Land Converted to Forest Land[8735]\n",
"│ │ ├── 4.B Cropland[9805]\n",
"│ │ │ ├── 4.B.1 Cropland Remaining Cropland[10430]\n",
"│ │ │ └── 4.B.2 Land Converted to Cropland[8678]\n",
"│ │ │ ├── 4.B.2.a Forest Land Converted to Cropland[9799]\n",
"│ │ │ ├── 4.B.2.b Grassland Converted to Cropland[9491]\n",
"│ │ │ ├── 4.B.2.c Wetlands Converted to Cropland[10450]\n",
"│ │ │ ├── 4.B.2.d Settlements Converted to Cropland[8709]\n",
"│ │ │ └── 4.B.2.e Other Land Converted to Cropland[9560]\n",
"│ │ ├── 4.C Grassland[8849]\n",
"│ │ │ ├── 4.C.1 Grassland Remaining Grassland[9360]\n",
"│ │ │ └── 4.C.2 Land Converted to Grassland[8259]\n",
"│ │ │ ├── 4.C.2.a Forest Land Converted to Grassland[9405]\n",
"│ │ │ ├── 4.C.2.b Cropland Converted to Grassland[9966]\n",
"│ │ │ ├── 4.C.2.c Wetlands Converted to Grassland[10323]\n",
"│ │ │ ├── 4.C.2.d Settlements Converted to Grassland[9444]\n",
"│ │ │ └── 4.C.2.e Other Land Converted to Grassland[10189]\n",
"│ │ ├── 4.D Wetlands[9897]\n",
"│ │ │ ├── 4.D.1 Wetlands Remaining Wetlands[9154]\n",
"│ │ │ │ ├── 4.D.1.a Peat Extraction Remaining Peat Extraction[10156]\n",
"│ │ │ │ ├── 4.D.1.b Flooded Land Remaining Flooded Land[9151]\n",
"│ │ │ │ └── 4.D.1.c Other Wetlands Remaining Other Wetlands[8307]\n",
"│ │ │ └── 4.D.2 Land Converted to Wetlands[8232]\n",
"│ │ │ ├── 4.D.2.a Land Converted to Peat Extraction[11002]\n",
"│ │ │ ├── 4.D.2.b Land Converted to Flooded Land[11003]\n",
"│ │ │ │ ├── 4.D.2.b.i Forest Land Converted to Flooded Land[11004]\n",
"│ │ │ │ ├── 4.D.2.b.ii Cropland Converted to Flooded Land[11005]\n",
"│ │ │ │ ├── 4.D.2.b.iii Grassland Converted to Flooded Land[11006]\n",
"│ │ │ │ ├── 4.D.2.b.iv Settlements Converted to Flooded Land[11007]\n",
"│ │ │ │ └── 4.D.2.b.v Other Land Converted to Flooded Land[11008]\n",
"│ │ │ └── 4.D.2.c Land Converted to Other Wetlands[11009]\n",
"│ │ │ ├── 4.D.2.c.i Forest Land Converted to Other Wetlands[11010]\n",
"│ │ │ ├── 4.D.2.c.ii Cropland Converted to Other Wetlands[11011]\n",
"│ │ │ ├── 4.D.2.c.iii Grassland Converted to Other Wetlands[11012]\n",
"│ │ │ ├── 4.D.2.c.iv Settlements Converted to Other Wetlands[11013]\n",
"│ │ │ └── 4.D.2.c.v Other Land Converted to Other Wetlands[11014]\n",
"│ │ ├── 4.E Settlements[10314]\n",
"│ │ │ ├── 4.E.1 Settlements Remaining Settlements[10132]\n",
"│ │ │ └── 4.E.2 Land Converted to Settlements[9506]\n",
"│ │ │ ├── 4.E.2.a Forest Land Converted to Settlements[10183]\n",
"│ │ │ ├── 4.E.2.b Cropland Converted to Settlements[9914]\n",
"│ │ │ ├── 4.E.2.c Grassland Converted to Settlements[10026]\n",
"│ │ │ ├── 4.E.2.d Wetlands Converted to Settlements[8465]\n",
"│ │ │ └── 4.E.2.e Other Land Converted to Settlements[9857]\n",
"│ │ ├── 4.F Other Land[8288]\n",
"│ │ │ ├── 4.F.1 Other Land Remaining Other Land[11015]\n",
"│ │ │ └── 4.F.2 Land Converted to Other Land[8343]\n",
"│ │ │ ├── 4.F.2.a Forest Land Converted to Other Land[8488]\n",
"│ │ │ ├── 4.F.2.b Cropland Converted to Other Land[8234]\n",
"│ │ │ ├── 4.F.2.c Grassland Converted to Other Land[8574]\n",
"│ │ │ ├── 4.F.2.d Wetlands Converted to Other Land[10371]\n",
"│ │ │ └── 4.F.2.e Settlements Converted to Other Land[9019]\n",
"│ │ ├── 4.G Harvested Wood Products[9133]\n",
"│ │ │ ├── 4.G.1 Solid Wood[11016]\n",
"│ │ │ │ ├── 4.G.1.a Sawnwood[11017]\n",
"│ │ │ │ ├── 4.G.1.b Wood Panels[11018]\n",
"│ │ │ │ └── 4.G.1.c Other Solid Wood Products[11019]\n",
"│ │ │ ├── 4.G.2 Paper and Paperboard[11020]\n",
"│ │ │ ├── 4.G.3 Other[11021]\n",
"│ │ │ └── Information Item[11035]\n",
"│ │ │ └── HWP in SWDS[11036]\n",
"│ │ └── 4.H Other[9158]\n",
"│ ├── 5. Waste[10159]\n",
"│ │ ├── 5.A Solid Waste Disposal[9284]\n",
"│ │ │ ├── 5.A.1 Managed Waste Disposal Sites[8477]\n",
"│ │ │ │ ├── 5.A.1.a Anaerobic[9839]\n",
"│ │ │ │ └── 5.A.1.b Semi-aerobic[9144]\n",
"│ │ │ ├── 5.A.2 Unmanaged Waste Disposal Sites[10235]\n",
"│ │ │ └── 5.A.3 Uncategorized Waste Disposal Sites[8652]\n",
"│ │ ├── 5.B Biological Treatment of Solid Waste[9245]\n",
"│ │ │ ├── 5.B.1 Composting[8701]\n",
"│ │ │ │ ├── 5.B.1.a Municipal Solid Waste[9682]\n",
"│ │ │ │ └── 5.B.1.b Other[8640]\n",
"│ │ │ └── 5.B.2 Anaerobic Digestion at Biogas Facilities[8225]\n",
"│ │ │ ├── 5.B.2.a Municipal Solid Waste[9290]\n",
"│ │ │ └── 5.B.2.b Other[9639]\n",
"│ │ ├── 5.C Incineration and Open Burning of Waste[8227]\n",
"│ │ │ ├── 5.C.1 Waste Incineration[10408]\n",
"│ │ │ │ ├── 5.C.1.a Biogenic[8776]\n",
"│ │ │ │ │ ├── 5.C.1.a.i Municipal Solid Waste[9069]\n",
"│ │ │ │ │ └── 5.C.1.a.ii Other[8401]\n",
"│ │ │ │ │ ├── 5.C.1.a.ii.1 Industrial Solid Wastes[8260]\n",
"│ │ │ │ │ ├── 5.C.1.a.ii.2 Hazardous Waste[9329]\n",
"│ │ │ │ │ ├── 5.C.1.a.ii.3 Clinical Waste[9141]\n",
"│ │ │ │ │ ├── 5.C.1.a.ii.4 Sewage Sludge[9538]\n",
"│ │ │ │ │ └── 5.C.1.a.ii.5 Other[9218]\n",
"│ │ │ │ └── 5.C.1.b Non-biogenic[9979]\n",
"│ │ │ │ ├── 5.C.1.b.i Municipal Solid Waste[10302]\n",
"│ │ │ │ └── 5.C.1.b.ii Other[9696]\n",
"│ │ │ │ ├── 5.C.1.b.ii.1 Industrial Solid Wastes[8158]\n",
"│ │ │ │ ├── 5.C.1.b.ii.2 Hazardous Waste[9250]\n",
"│ │ │ │ ├── 5.C.1.b.ii.3 Clinical Waste[10050]\n",
"│ │ │ │ ├── 5.C.1.b.ii.4 Sewage Sludge[8619]\n",
"│ │ │ │ ├── 5.C.1.b.ii.5 Fossil Liquid Waste[9730]\n",
"│ │ │ │ └── 5.C.1.b.ii.6 Other[9649]\n",
"│ │ │ └── 5.C.2 Open Burning of Waste[8943]\n",
"│ │ │ ├── 5.C.2.a Biogenic[8825]\n",
"│ │ │ │ ├── 5.C.2.a.i Municipal Solid Waste[10182]\n",
"│ │ │ │ └── 5.C.2.a.ii Other[8772]\n",
"│ │ │ └── 5.C.2.b Non-biogenic[8910]\n",
"│ │ │ ├── 5.C.2.b.i Municipal Solid Waste[8768]\n",
"│ │ │ └── 5.C.2.b.ii Other[9181]\n",
"│ │ ├── 5.D Wastewater Treatment and Discharge[8423]\n",
"│ │ │ ├── 5.D.1 Domestic Wastewater[10391]\n",
"│ │ │ ├── 5.D.2 Industrial Wastewater[9831]\n",
"│ │ │ └── 5.D.3 Other[8153]\n",
"│ │ ├── 5.E Other[8284]\n",
"│ │ └── Memo Items[11022]\n",
"│ │ ├── Annual Change in Total Long-term C Storage[11024]\n",
"│ │ ├── Annual Change in Total Long-term C Storage in HWP Waste[11025]\n",
"│ │ └── Long-term Storage of C in Waste Disposal Sites[11023]\n",
"│ └── 6. Other[10476]\n",
"├── Total GHG emissions with LULUCF including indirect CO₂[10480]\n",
"├── Total GHG emissions without LULUCF[10464]\n",
"│ ├── 1. Energy[10481]\n",
"│ ├── 2. Industrial Processes and Product Use[10482]\n",
"│ ├── 3. Agriculture[10483]\n",
"│ ├── 5. Waste[10484]\n",
"│ └── 6. Other[10485]\n",
"└── Total GHG emissions without LULUCF including indirect CO₂[10479]\n",
"\n"
]
}
],
"source": [
"# categories and measures are available in hierarchies\n",
"#r.annex_one_reader.category_tree\n",
"#r.annex_one_reader.measure_tree\n",
"\n",
"# for easier viewing, use the associated methods; note the id in brackets that you need if you want to query for a specific category/measure\n",
"#r.annex_one_reader.show_measure_hierarchy()\n",
"r.annex_one_reader.show_category_hierarchy()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:53.385860Z",
"iopub.status.busy": "2020-10-26T15:58:53.385220Z",
"iopub.status.idle": "2020-10-26T15:58:53.396701Z",
"shell.execute_reply": "2020-10-26T15:58:53.395372Z",
"shell.execute_reply.started": "2020-10-26T15:58:53.385809Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m\n",
"\u001b[0mr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mannex_one_reader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquery\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mparty_codes\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mcategory_ids\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mNoneType\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mclassifications\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mNoneType\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mmeasure_ids\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mNoneType\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mgases\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mNoneType\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mbatch_size\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1000\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mprogress\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mpandas\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mframe\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m\n",
"Query the UNFCCC for data.\n",
":param party_codes: list of ISO codes of the parties to query.\n",
" For possible values, see .parties .\n",
":param category_ids: list of category IDs to query. For possible values, see .show_category_hierarchy().\n",
" Default: query for all categories.\n",
":param classifications: list of classifications to query. For possible values, see .classifications .\n",
" Default: query for all classifications.\n",
":param measure_ids: list of measure IDs to query. For possible values, see .show_measure_hierarchy().\n",
" Default: query for all measures.\n",
":param gases: list of gases to query. For possible values, see .gases .\n",
" Default: query for all gases.\n",
":param batch_size: number of variables to query in a single API query in the same batch to avoid internal\n",
" server errors. Larger queries are split automatically.\n",
":param progress: show a progress bar. Requires tqdm.\n",
"\u001b[0;31mFile:\u001b[0m ~/work/read_di_unfccc/read_di_unfccc.py\n",
"\u001b[0;31mType:\u001b[0m method\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# for obtaining information from the database, use query()\n",
"r.annex_one_reader.query?"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T15:58:54.566663Z",
"iopub.status.busy": "2020-10-26T15:58:54.566334Z",
"iopub.status.idle": "2020-10-26T15:58:54.772132Z",
"shell.execute_reply": "2020-10-26T15:58:54.771480Z",
"shell.execute_reply.started": "2020-10-26T15:58:54.566629Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" index | \n",
" party | \n",
" category | \n",
" classification | \n",
" measure | \n",
" gas | \n",
" unit | \n",
" year | \n",
" numberValue | \n",
" stringValue | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 1 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1990 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 1 | \n",
" 2 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1991 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 2 | \n",
" 3 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1992 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 3 | \n",
" 4 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1993 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 4 | \n",
" 5 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1994 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 5 | \n",
" 6 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1995 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 6 | \n",
" 7 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1996 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 7 | \n",
" 8 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1997 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 8 | \n",
" 9 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1998 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 9 | \n",
" 10 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 1999 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 10 | \n",
" 11 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2000 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 11 | \n",
" 12 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2001 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 12 | \n",
" 13 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2002 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 13 | \n",
" 14 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2003 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 14 | \n",
" 15 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2004 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 15 | \n",
" 16 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2005 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 16 | \n",
" 17 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2006 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 17 | \n",
" 18 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2007 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 18 | \n",
" 19 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2008 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 19 | \n",
" 20 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2009 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 20 | \n",
" 21 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2010 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 21 | \n",
" 22 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2011 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 22 | \n",
" 23 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2012 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 23 | \n",
" 24 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2013 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 24 | \n",
" 25 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2014 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 25 | \n",
" 26 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2015 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 26 | \n",
" 27 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2016 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 27 | \n",
" 28 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2017 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 28 | \n",
" 29 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" 2018 | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
" 29 | \n",
" 0 | \n",
" DEU | \n",
" 5.A.1.a Anaerobic | \n",
" Total for category | \n",
" Net emissions/removals | \n",
" CO₂ | \n",
" kt | \n",
" Base year | \n",
" None | \n",
" NA | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" index party category classification \\\n",
"0 1 DEU 5.A.1.a Anaerobic Total for category \n",
"1 2 DEU 5.A.1.a Anaerobic Total for category \n",
"2 3 DEU 5.A.1.a Anaerobic Total for category \n",
"3 4 DEU 5.A.1.a Anaerobic Total for category \n",
"4 5 DEU 5.A.1.a Anaerobic Total for category \n",
"5 6 DEU 5.A.1.a Anaerobic Total for category \n",
"6 7 DEU 5.A.1.a Anaerobic Total for category \n",
"7 8 DEU 5.A.1.a Anaerobic Total for category \n",
"8 9 DEU 5.A.1.a Anaerobic Total for category \n",
"9 10 DEU 5.A.1.a Anaerobic Total for category \n",
"10 11 DEU 5.A.1.a Anaerobic Total for category \n",
"11 12 DEU 5.A.1.a Anaerobic Total for category \n",
"12 13 DEU 5.A.1.a Anaerobic Total for category \n",
"13 14 DEU 5.A.1.a Anaerobic Total for category \n",
"14 15 DEU 5.A.1.a Anaerobic Total for category \n",
"15 16 DEU 5.A.1.a Anaerobic Total for category \n",
"16 17 DEU 5.A.1.a Anaerobic Total for category \n",
"17 18 DEU 5.A.1.a Anaerobic Total for category \n",
"18 19 DEU 5.A.1.a Anaerobic Total for category \n",
"19 20 DEU 5.A.1.a Anaerobic Total for category \n",
"20 21 DEU 5.A.1.a Anaerobic Total for category \n",
"21 22 DEU 5.A.1.a Anaerobic Total for category \n",
"22 23 DEU 5.A.1.a Anaerobic Total for category \n",
"23 24 DEU 5.A.1.a Anaerobic Total for category \n",
"24 25 DEU 5.A.1.a Anaerobic Total for category \n",
"25 26 DEU 5.A.1.a Anaerobic Total for category \n",
"26 27 DEU 5.A.1.a Anaerobic Total for category \n",
"27 28 DEU 5.A.1.a Anaerobic Total for category \n",
"28 29 DEU 5.A.1.a Anaerobic Total for category \n",
"29 0 DEU 5.A.1.a Anaerobic Total for category \n",
"\n",
" measure gas unit year numberValue stringValue \n",
"0 Net emissions/removals CO₂ kt 1990 None NA \n",
"1 Net emissions/removals CO₂ kt 1991 None NA \n",
"2 Net emissions/removals CO₂ kt 1992 None NA \n",
"3 Net emissions/removals CO₂ kt 1993 None NA \n",
"4 Net emissions/removals CO₂ kt 1994 None NA \n",
"5 Net emissions/removals CO₂ kt 1995 None NA \n",
"6 Net emissions/removals CO₂ kt 1996 None NA \n",
"7 Net emissions/removals CO₂ kt 1997 None NA \n",
"8 Net emissions/removals CO₂ kt 1998 None NA \n",
"9 Net emissions/removals CO₂ kt 1999 None NA \n",
"10 Net emissions/removals CO₂ kt 2000 None NA \n",
"11 Net emissions/removals CO₂ kt 2001 None NA \n",
"12 Net emissions/removals CO₂ kt 2002 None NA \n",
"13 Net emissions/removals CO₂ kt 2003 None NA \n",
"14 Net emissions/removals CO₂ kt 2004 None NA \n",
"15 Net emissions/removals CO₂ kt 2005 None NA \n",
"16 Net emissions/removals CO₂ kt 2006 None NA \n",
"17 Net emissions/removals CO₂ kt 2007 None NA \n",
"18 Net emissions/removals CO₂ kt 2008 None NA \n",
"19 Net emissions/removals CO₂ kt 2009 None NA \n",
"20 Net emissions/removals CO₂ kt 2010 None NA \n",
"21 Net emissions/removals CO₂ kt 2011 None NA \n",
"22 Net emissions/removals CO₂ kt 2012 None NA \n",
"23 Net emissions/removals CO₂ kt 2013 None NA \n",
"24 Net emissions/removals CO₂ kt 2014 None NA \n",
"25 Net emissions/removals CO₂ kt 2015 None NA \n",
"26 Net emissions/removals CO₂ kt 2016 None NA \n",
"27 Net emissions/removals CO₂ kt 2017 None NA \n",
"28 Net emissions/removals CO₂ kt 2018 None NA \n",
"29 Net emissions/removals CO₂ kt Base year None NA "
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Fine-grained control is possible\n",
"# Ex. query for german net emissions/removals of CO₂ in the category 5.A.1.a\n",
"# You have to provide categories and measures using IDs, because names are not necessarily unique\n",
"r.annex_one_reader.query(party_codes=['DEU'], category_ids=[9839], gases=['CO₂'], measure_ids=[10460])"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T16:16:08.055458Z",
"iopub.status.busy": "2020-10-26T16:16:08.054550Z",
"iopub.status.idle": "2020-10-26T16:16:08.474684Z",
"shell.execute_reply": "2020-10-26T16:16:08.473456Z",
"shell.execute_reply.started": "2020-10-26T16:16:08.055378Z"
}
},
"outputs": [],
"source": [
"df = r.query(party_code='AFG')"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"execution": {
"iopub.execute_input": "2020-10-26T16:16:15.011776Z",
"iopub.status.busy": "2020-10-26T16:16:15.011427Z",
"iopub.status.idle": "2020-10-26T16:16:15.025492Z",
"shell.execute_reply": "2020-10-26T16:16:15.024684Z",
"shell.execute_reply.started": "2020-10-26T16:16:15.011745Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m\n",
"\u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreset_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mlevel\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mHashable\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mSequence\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mHashable\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mdrop\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0minplace\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mcol_level\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mHashable\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mcol_fill\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mHashable\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m''\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mForwardRef\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'DataFrame'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m\n",
"Reset the index, or a level of it.\n",
"\n",
"Reset the index of the DataFrame, and use the default one instead.\n",
"If the DataFrame has a MultiIndex, this method can remove one or more\n",
"levels.\n",
"\n",
"Parameters\n",
"----------\n",
"level : int, str, tuple, or list, default None\n",
" Only remove the given levels from the index. Removes all levels by\n",
" default.\n",
"drop : bool, default False\n",
" Do not try to insert index into dataframe columns. This resets\n",
" the index to the default integer index.\n",
"inplace : bool, default False\n",
" Modify the DataFrame in place (do not create a new object).\n",
"col_level : int or str, default 0\n",
" If the columns have multiple levels, determines which level the\n",
" labels are inserted into. By default it is inserted into the first\n",
" level.\n",
"col_fill : object, default ''\n",
" If the columns have multiple levels, determines how the other\n",
" levels are named. If None then the index name is repeated.\n",
"\n",
"Returns\n",
"-------\n",
"DataFrame or None\n",
" DataFrame with the new index or None if ``inplace=True``.\n",
"\n",
"See Also\n",
"--------\n",
"DataFrame.set_index : Opposite of reset_index.\n",
"DataFrame.reindex : Change to new indices or expand indices.\n",
"DataFrame.reindex_like : Change to same indices as other DataFrame.\n",
"\n",
"Examples\n",
"--------\n",
">>> df = pd.DataFrame([('bird', 389.0),\n",
"... ('bird', 24.0),\n",
"... ('mammal', 80.5),\n",
"... ('mammal', np.nan)],\n",
"... index=['falcon', 'parrot', 'lion', 'monkey'],\n",
"... columns=('class', 'max_speed'))\n",
">>> df\n",
" class max_speed\n",
"falcon bird 389.0\n",
"parrot bird 24.0\n",
"lion mammal 80.5\n",
"monkey mammal NaN\n",
"\n",
"When we reset the index, the old index is added as a column, and a\n",
"new sequential index is used:\n",
"\n",
">>> df.reset_index()\n",
" index class max_speed\n",
"0 falcon bird 389.0\n",
"1 parrot bird 24.0\n",
"2 lion mammal 80.5\n",
"3 monkey mammal NaN\n",
"\n",
"We can use the `drop` parameter to avoid the old index being added as\n",
"a column:\n",
"\n",
">>> df.reset_index(drop=True)\n",
" class max_speed\n",
"0 bird 389.0\n",
"1 bird 24.0\n",
"2 mammal 80.5\n",
"3 mammal NaN\n",
"\n",
"You can also use `reset_index` with `MultiIndex`.\n",
"\n",
">>> index = pd.MultiIndex.from_tuples([('bird', 'falcon'),\n",
"... ('bird', 'parrot'),\n",
"... ('mammal', 'lion'),\n",
"... ('mammal', 'monkey')],\n",
"... names=['class', 'name'])\n",
">>> columns = pd.MultiIndex.from_tuples([('speed', 'max'),\n",
"... ('species', 'type')])\n",
">>> df = pd.DataFrame([(389.0, 'fly'),\n",
"... ( 24.0, 'fly'),\n",
"... ( 80.5, 'run'),\n",
"... (np.nan, 'jump')],\n",
"... index=index,\n",
"... columns=columns)\n",
">>> df\n",
" speed species\n",
" max type\n",
"class name\n",
"bird falcon 389.0 fly\n",
" parrot 24.0 fly\n",
"mammal lion 80.5 run\n",
" monkey NaN jump\n",
"\n",
"If the index has multiple levels, we can reset a subset of them:\n",
"\n",
">>> df.reset_index(level='class')\n",
" class speed species\n",
" max type\n",
"name\n",
"falcon bird 389.0 fly\n",
"parrot bird 24.0 fly\n",
"lion mammal 80.5 run\n",
"monkey mammal NaN jump\n",
"\n",
"If we are not dropping the index, by default, it is placed in the top\n",
"level. We can place it in another level:\n",
"\n",
">>> df.reset_index(level='class', col_level=1)\n",
" speed species\n",
" class max type\n",
"name\n",
"falcon bird 389.0 fly\n",
"parrot bird 24.0 fly\n",
"lion mammal 80.5 run\n",
"monkey mammal NaN jump\n",
"\n",
"When the index is inserted under another level, we can specify under\n",
"which one with the parameter `col_fill`:\n",
"\n",
">>> df.reset_index(level='class', col_level=1, col_fill='species')\n",
" species speed species\n",
" class max type\n",
"name\n",
"falcon bird 389.0 fly\n",
"parrot bird 24.0 fly\n",
"lion mammal 80.5 run\n",
"monkey mammal NaN jump\n",
"\n",
"If we specify a nonexistent level for `col_fill`, it is created:\n",
"\n",
">>> df.reset_index(level='class', col_level=1, col_fill='genus')\n",
" genus speed species\n",
" class max type\n",
"name\n",
"falcon bird 389.0 fly\n",
"parrot bird 24.0 fly\n",
"lion mammal 80.5 run\n",
"monkey mammal NaN jump\n",
"\u001b[0;31mFile:\u001b[0m ~/.local/lib/python3.8/site-packages/pandas/core/frame.py\n",
"\u001b[0;31mType:\u001b[0m method\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df.reset_index?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}