\n",
" \n",
" 11 | \n",
" Tarawa | \n",
- " POINT (173.01757 1.33819) | \n",
- " 11 | \n",
- " 1.338188 | \n",
- " 173.017571 | \n",
+ " 0.107688 | \n",
" 1 | \n",
+ " POINT (173.01757 1.33819) | \n",
"
\n",
" \n",
" 15 | \n",
" Kigali | \n",
- " POINT (30.05859 -1.95164) | \n",
- " 15 | \n",
- " -1.951644 | \n",
- " 30.058586 | \n",
+ " 0.218687 | \n",
" 1 | \n",
+ " POINT (30.05859 -1.95164) | \n",
"
\n",
" \n",
" 17 | \n",
" Juba | \n",
- " POINT (31.58003 4.82998) | \n",
- " 17 | \n",
- " 4.829975 | \n",
- " 31.580026 | \n",
+ " 0.763743 | \n",
" 1 | \n",
+ " POINT (31.58003 4.82998) | \n",
"
\n",
" \n",
" 31 | \n",
" Putrajaya | \n",
- " POINT (101.69504 2.93252) | \n",
- " 31 | \n",
- " 2.932515 | \n",
- " 101.695037 | \n",
+ " 0.533607 | \n",
" 1 | \n",
+ " POINT (101.69504 2.93252) | \n",
"
\n",
" \n",
" 37 | \n",
" Bujumbura | \n",
+ " 0.127881 | \n",
+ " 1 | \n",
" POINT (29.36001 -3.37609) | \n",
- " 37 | \n",
- " -3.376087 | \n",
- " 29.360006 | \n",
+ "
\n",
+ " \n",
+ " 58 | \n",
+ " Kampala | \n",
+ " 0.079019 | \n",
" 1 | \n",
+ " POINT (32.58138 0.31860) | \n",
+ "
\n",
+ " \n",
+ " 75 | \n",
+ " Mogadishu | \n",
+ " 0.696766 | \n",
+ " 1 | \n",
+ " POINT (45.36473 2.06863) | \n",
+ "
\n",
+ " \n",
+ " 88 | \n",
+ " Quito | \n",
+ " 0.212070 | \n",
+ " 1 | \n",
+ " POINT (-78.50200 -0.21304) | \n",
+ "
\n",
+ " \n",
+ " 93 | \n",
+ " Malabo | \n",
+ " 0.088459 | \n",
+ " 1 | \n",
+ " POINT (8.78328 3.75002) | \n",
+ "
\n",
+ " \n",
+ " 99 | \n",
+ " Libreville | \n",
+ " 0.929139 | \n",
+ " 1 | \n",
+ " POINT (9.45796 0.38539) | \n",
+ "
\n",
+ " \n",
+ " 108 | \n",
+ " Brazzaville | \n",
+ " 0.795766 | \n",
+ " 1 | \n",
+ " POINT (15.28274 -4.25724) | \n",
+ "
\n",
+ " \n",
+ " 113 | \n",
+ " Bandar Seri Begawan | \n",
+ " 0.655856 | \n",
+ " 1 | \n",
+ " POINT (114.93328 4.88333) | \n",
+ "
\n",
+ " \n",
+ " 116 | \n",
+ " Bangui | \n",
+ " 0.398002 | \n",
+ " 1 | \n",
+ " POINT (18.55829 4.36664) | \n",
+ "
\n",
+ " \n",
+ " 117 | \n",
+ " Yaoundé | \n",
+ " 0.240599 | \n",
+ " 1 | \n",
+ " POINT (11.51470 3.86865) | \n",
+ "
\n",
+ " \n",
+ " 134 | \n",
+ " Victoria | \n",
+ " 0.956208 | \n",
+ " 1 | \n",
+ " POINT (55.44999 -4.61663) | \n",
+ "
\n",
+ " \n",
+ " 135 | \n",
+ " São Tomé | \n",
+ " 0.726704 | \n",
+ " 1 | \n",
+ " POINT (6.72965 0.33747) | \n",
+ "
\n",
+ " \n",
+ " 138 | \n",
+ " Malé | \n",
+ " 0.996017 | \n",
+ " 1 | \n",
+ " POINT (73.50890 4.17204) | \n",
+ "
\n",
+ " \n",
+ " 158 | \n",
+ " Kuala Lumpur | \n",
+ " 0.880473 | \n",
+ " 1 | \n",
+ " POINT (101.68870 3.13980) | \n",
+ "
\n",
+ " \n",
+ " 201 | \n",
+ " Kinshasa | \n",
+ " 0.074387 | \n",
+ " 1 | \n",
+ " POINT (15.31303 -4.32778) | \n",
+ "
\n",
+ " \n",
+ " 228 | \n",
+ " Nairobi | \n",
+ " 0.297170 | \n",
+ " 1 | \n",
+ " POINT (36.81471 -1.28140) | \n",
+ "
\n",
+ " \n",
+ " 230 | \n",
+ " Bogota | \n",
+ " 0.420891 | \n",
+ " 1 | \n",
+ " POINT (-74.08529 4.59837) | \n",
+ "
\n",
+ " \n",
+ " 241 | \n",
+ " Singapore | \n",
+ " 0.830635 | \n",
+ " 1 | \n",
+ " POINT (103.85387 1.29498) | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " name geometry value latitude longitude impf_TC\n",
- "11 Tarawa POINT (173.01757 1.33819) 11 1.338188 173.017571 1\n",
- "15 Kigali POINT (30.05859 -1.95164) 15 -1.951644 30.058586 1\n",
- "17 Juba POINT (31.58003 4.82998) 17 4.829975 31.580026 1\n",
- "31 Putrajaya POINT (101.69504 2.93252) 31 2.932515 101.695037 1\n",
- "37 Bujumbura POINT (29.36001 -3.37609) 37 -3.376087 29.360006 1"
+ " name value impf_TC geometry\n",
+ "11 Tarawa 0.107688 1 POINT (173.01757 1.33819)\n",
+ "15 Kigali 0.218687 1 POINT (30.05859 -1.95164)\n",
+ "17 Juba 0.763743 1 POINT (31.58003 4.82998)\n",
+ "31 Putrajaya 0.533607 1 POINT (101.69504 2.93252)\n",
+ "37 Bujumbura 0.127881 1 POINT (29.36001 -3.37609)\n",
+ "58 Kampala 0.079019 1 POINT (32.58138 0.31860)\n",
+ "75 Mogadishu 0.696766 1 POINT (45.36473 2.06863)\n",
+ "88 Quito 0.212070 1 POINT (-78.50200 -0.21304)\n",
+ "93 Malabo 0.088459 1 POINT (8.78328 3.75002)\n",
+ "99 Libreville 0.929139 1 POINT (9.45796 0.38539)\n",
+ "108 Brazzaville 0.795766 1 POINT (15.28274 -4.25724)\n",
+ "113 Bandar Seri Begawan 0.655856 1 POINT (114.93328 4.88333)\n",
+ "116 Bangui 0.398002 1 POINT (18.55829 4.36664)\n",
+ "117 Yaoundé 0.240599 1 POINT (11.51470 3.86865)\n",
+ "134 Victoria 0.956208 1 POINT (55.44999 -4.61663)\n",
+ "135 São Tomé 0.726704 1 POINT (6.72965 0.33747)\n",
+ "138 Malé 0.996017 1 POINT (73.50890 4.17204)\n",
+ "158 Kuala Lumpur 0.880473 1 POINT (101.68870 3.13980)\n",
+ "201 Kinshasa 0.074387 1 POINT (15.31303 -4.32778)\n",
+ "228 Nairobi 0.297170 1 POINT (36.81471 -1.28140)\n",
+ "230 Bogota 0.420891 1 POINT (-74.08529 4.59837)\n",
+ "241 Singapore 0.830635 1 POINT (103.85387 1.29498)"
]
},
- "execution_count": 11,
+ "execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
@@ -548,15 +718,15 @@
"source": [
"# Example 1: extract data in a region: latitudes between -5 and 5\n",
"sel_exp = exp_gpd.copy() # to keep the original exp_gpd Exposures data\n",
- "sel_exp.gdf = sel_exp.gdf.cx[:, -5:5]\n",
+ "sel_exp.data = sel_exp.data.cx[:, -5:5]\n",
"\n",
"print('\\n' + 'sel_exp contains a subset of the original data')\n",
- "sel_exp.gdf.head()"
+ "sel_exp.data"
]
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 29,
"metadata": {},
"outputs": [
{
@@ -589,83 +759,69 @@
" \n",
" \n",
" 36 | \n",
" Porto-Novo | \n",
- " POINT (291281.418 718442.692) | \n",
- " 36 | \n",
- " 718442.691819 | \n",
- " 291281.418257 | \n",
+ " 0.573619 | \n",
" 1 | \n",
+ " POINT (291281.418 718442.692) | \n",
"
\n",
" \n",
" 46 | \n",
" Lomé | \n",
- " POINT (135900.092 679566.331) | \n",
- " 46 | \n",
- " 679566.330586 | \n",
- " 135900.092271 | \n",
+ " 0.176892 | \n",
" 1 | \n",
+ " POINT (135900.092 679566.331) | \n",
"
\n",
" \n",
" 93 | \n",
" Malabo | \n",
- " POINT (977749.979 414955.553) | \n",
- " 93 | \n",
- " 414955.553292 | \n",
- " 977749.978796 | \n",
+ " 0.088459 | \n",
" 1 | \n",
+ " POINT (977749.979 414955.553) | \n",
"
\n",
" \n",
" 123 | \n",
" Cotonou | \n",
- " POINT (267651.551 705052.049) | \n",
- " 123 | \n",
- " 705052.049006 | \n",
- " 267651.551008 | \n",
+ " 0.441703 | \n",
" 1 | \n",
+ " POINT (267651.551 705052.049) | \n",
"
\n",
" \n",
" 135 | \n",
" São Tomé | \n",
- " POINT (749141.190 37315.322) | \n",
- " 135 | \n",
- " 37315.322206 | \n",
- " 749141.189651 | \n",
+ " 0.726704 | \n",
" 1 | \n",
+ " POINT (749141.190 37315.322) | \n",
"
\n",
" \n",
" 225 | \n",
" Lagos | \n",
- " POINT (377326.898 714202.107) | \n",
- " 225 | \n",
- " 714202.106826 | \n",
- " 377326.898464 | \n",
+ " 0.990135 | \n",
" 1 | \n",
+ " POINT (377326.898 714202.107) | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " name geometry value latitude \\\n",
- "36 Porto-Novo POINT (291281.418 718442.692) 36 718442.691819 \n",
- "46 Lomé POINT (135900.092 679566.331) 46 679566.330586 \n",
- "93 Malabo POINT (977749.979 414955.553) 93 414955.553292 \n",
- "123 Cotonou POINT (267651.551 705052.049) 123 705052.049006 \n",
- "135 São Tomé POINT (749141.190 37315.322) 135 37315.322206 \n",
- "225 Lagos POINT (377326.898 714202.107) 225 714202.106826 \n",
- "\n",
- " longitude impf_TC \n",
- "36 291281.418257 1 \n",
- "46 135900.092271 1 \n",
- "93 977749.978796 1 \n",
- "123 267651.551008 1 \n",
- "135 749141.189651 1 \n",
- "225 377326.898464 1 "
+ " name value impf_TC geometry\n",
+ "36 Porto-Novo 0.573619 1 POINT (291281.418 718442.692)\n",
+ "46 Lomé 0.176892 1 POINT (135900.092 679566.331)\n",
+ "93 Malabo 0.088459 1 POINT (977749.979 414955.553)\n",
+ "123 Cotonou 0.441703 1 POINT (267651.551 705052.049)\n",
+ "135 São Tomé 0.726704 1 POINT (749141.190 37315.322)\n",
+ "225 Lagos 0.990135 1 POINT (377326.898 714202.107)"
]
},
- "execution_count": 13,
+ "execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
@@ -815,20 +948,20 @@
"sel_polygon.to_crs(epsg=3395, inplace=True)\n",
"print('\\n' + 'the crs has changed to ' +str(sel_polygon.crs))\n",
"print('the values for latitude and longitude are now according to the new coordinate system: ')\n",
- "sel_polygon.gdf"
+ "sel_polygon.data"
]
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "exp_all type and number of rows: