Skip to content

Commit

Permalink
clean outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
BielStela committed Nov 27, 2023
1 parent 2213f63 commit 97926cb
Showing 1 changed file with 18 additions and 104 deletions.
122 changes: 18 additions & 104 deletions science/notebooks/parse_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "initial_id",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.070934777Z",
"start_time": "2023-11-24T12:02:02.050112408Z"
},
"collapsed": true
},
"outputs": [],
Expand All @@ -35,13 +31,9 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "d818527072dc8fa4",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.180290616Z",
"start_time": "2023-11-24T12:02:02.058542286Z"
},
"collapsed": false
},
"outputs": [],
Expand Down Expand Up @@ -82,13 +74,9 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "488a7571958f020e",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.751974029Z",
"start_time": "2023-11-24T12:02:02.121734274Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -98,13 +86,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "5d8f9bcec39161ca",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.786580914Z",
"start_time": "2023-11-24T12:02:02.754063878Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -117,39 +101,22 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "9470191f5eae472d",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.801618533Z",
"start_time": "2023-11-24T12:02:02.789382852Z"
},
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": "{'category': ['CARICOM',\n 'OECS',\n 'Overseas Territory',\n 'Climate Impact Risk ',\n 'CO2 emissions (Category)',\n 'Climate Policy (NDC)',\n 'Climate Policy (Adaptation Communication)'],\n 'continuous': ['CO2 emissions (tons per capita)',\n 'Climate Adaptation, Implementation Cost (estimated)',\n 'Climate Mitigation, Implementation Cost (estiamted)',\n 'Total Damage Caused by Disasters (2000-2021)',\n 'People Affected by Disasters (2000-2021)',\n 'Readiness- GAIN Index']}"
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"types = datasets_info.group_by(\"Type\").agg(pl.col(\"ID\")).transpose().to_dict(as_series=False)\n",
"types = {e[0][0]: e[1] for e in types.values()}"
]
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "2ee669932a1cfa55",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.801871856Z",
"start_time": "2023-11-24T12:02:02.797922149Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -162,13 +129,9 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "3e046dc68615da8",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.809987424Z",
"start_time": "2023-11-24T12:02:02.800331016Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -180,13 +143,9 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "b6ef77466f39dc14",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.908866268Z",
"start_time": "2023-11-24T12:02:02.846089824Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -211,13 +170,9 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"id": "d7e9143419da120d",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.916123559Z",
"start_time": "2023-11-24T12:02:02.908717865Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -228,38 +183,21 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"id": "433430f740954e8d",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.925770670Z",
"start_time": "2023-11-24T12:02:02.914650678Z"
},
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": "[{'iso3': 'ABW', 'value': None},\n {'iso3': 'AIA', 'value': None},\n {'iso3': 'ATG', 'value': 1700000000.0},\n {'iso3': 'BES', 'value': None},\n {'iso3': 'BHS', 'value': 4000000000.0},\n {'iso3': 'BLZ', 'value': 318128096.0},\n {'iso3': 'BMU', 'value': None},\n {'iso3': 'BRB', 'value': 100000000.0},\n {'iso3': 'CRI', 'value': None},\n {'iso3': 'CUW', 'value': 151700000.0},\n {'iso3': 'CYM', 'value': None},\n {'iso3': 'DMA', 'value': None},\n {'iso3': 'DOM', 'value': 8732342272.0},\n {'iso3': 'GLP', 'value': None},\n {'iso3': 'GRD', 'value': 259400000.0},\n {'iso3': 'GUY', 'value': None},\n {'iso3': 'HND', 'value': None},\n {'iso3': 'HTI', 'value': 980000000.0},\n {'iso3': 'JAM', 'value': None},\n {'iso3': 'KNA', 'value': None},\n {'iso3': 'LCA', 'value': None},\n {'iso3': 'MEX', 'value': None},\n {'iso3': 'MSR', 'value': None},\n {'iso3': 'PAN', 'value': None},\n {'iso3': 'SUR', 'value': None},\n {'iso3': 'TCA', 'value': None},\n {'iso3': 'TTO', 'value': 19570004.0},\n {'iso3': 'VCT', 'value': None},\n {'iso3': 'VGB', 'value': None},\n {'iso3': 'VIR', 'value': None}]"
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"make_datum(\"Climate Adaptation, Implementation Cost (estimated)\")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"id": "8a723924bc0d0659",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:02:02.966032677Z",
"start_time": "2023-11-24T12:02:02.921856900Z"
},
"collapsed": false
},
"outputs": [],
Expand All @@ -280,13 +218,9 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": null,
"id": "8650aab7d8d402bb",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:12:39.309109007Z",
"start_time": "2023-11-24T12:12:39.295781009Z"
},
"collapsed": false
},
"outputs": [],
Expand Down Expand Up @@ -381,38 +315,22 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": null,
"id": "4c2081ae1aacae52",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:12:40.835518807Z",
"start_time": "2023-11-24T12:12:40.120667799Z"
},
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'CARICOM Members': 35, 'Climate Readiness - Adapation estimated cost': 41, 'OECS Members': 36, 'Overseas Territory or Constituent Country': 37, 'Climate Policy': 46, 'Climate Impact Risk Level': 38, 'CO2 emissions (Tons per Capita)': 39, 'CO2 emissions level': 40, 'Climate Readiness - Mitigation estimated cost': 42, 'Loss and Damage': 43, 'Lives and Livelihoods': 44, 'Climate Readiness (ND-GAIN Score)': 45, 'Climate Adaptation Plan': 47}\n"
]
}
],
"outputs": [],
"source": [
"dataset_ids = get_ids(\"datasets\")\n",
"print(dataset_ids)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": null,
"id": "8681c1d95493974c",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:12:40.895623718Z",
"start_time": "2023-11-24T12:12:40.840057059Z"
},
"collapsed": false
},
"outputs": [],
Expand Down Expand Up @@ -445,13 +363,9 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": null,
"id": "d0a17b731fcdf6af",
"metadata": {
"ExecuteTime": {
"end_time": "2023-11-24T12:12:41.486034418Z",
"start_time": "2023-11-24T12:12:41.483018384Z"
},
"collapsed": false
},
"outputs": [],
Expand Down

0 comments on commit 97926cb

Please sign in to comment.