diff --git a/Building_selection.ipynb b/Building_selection.ipynb index dafbd80..b61bf48 100644 --- a/Building_selection.ipynb +++ b/Building_selection.ipynb @@ -2169,7 +2169,7 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 69, "metadata": {}, "outputs": [ { @@ -2198,8 +2198,8 @@ "source": [ "# remove the rows that are available in lod2 offices from office_buildings_cleaned, office_buildings_cleaned ID_UEV has 0 before the ID_UEV in lod2_offices\n", "lod1_offices = office_buildings_cleaned[~office_buildings_cleaned['ID_UEV'].isin(lod2_offices['ID_UEV'])]\n", - "lod1_offices\n", - "\n", + " \n", + "lod1_offices['lod']='lod1'\n", "# Create a nested dictionary to store the filtered buildings\n", "lod1_buildings_dict = {\n", " 'detached': filter_buildings_by_year_and_category(lod1_offices, 'detached', year_groups, area_categories),\n", @@ -2212,7 +2212,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 58, "metadata": {}, "outputs": [ { @@ -2251,7 +2251,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -2300,9 +2300,33 @@ " \n", " \n", " \n", - " 6\n", + " 17013\n", + " 36076\n", + " 05030608\n", + " 4477\n", + " 5605\n", + " boulevard Pie-IX (MTL+MTN+SLN)\n", + " 50\n", + " 6000\n", + " Immeuble à bureaux\n", + " Régulier\n", + " 20\n", + " ...\n", + " POLYGON ((-73.56772 45.55916, -73.56775 45.559...\n", + " 1930\n", + " 1.954238\n", + " 0.050000\n", + " POLYGON ((611782.360 5046066.630, 611779.902 5...\n", + " 48.162656\n", + " 1800-1945\n", + " Mega office\n", + " 4-9 floors\n", + " lod1\n", + " \n", + " \n", + " 472072\n", " 152835\n", - " 5027487\n", + " 05027487\n", " 2200\n", " 2222\n", " rue Sainte-Catherine Est (MTE+MTL)\n", @@ -2312,21 +2336,45 @@ " Régulier\n", " 33\n", " ...\n", - " POLYGON ((-73.54820576510775 45.52676864822449...\n", + " POLYGON ((-73.54821 45.52677, -73.54826 45.526...\n", " 1930\n", " 1.436573\n", " 0.030303\n", - " POLYGON ((613370.0745799394 5042495.465036549,...\n", + " POLYGON ((613370.075 5042495.465, 613365.907 5...\n", " 8527.804906\n", " 1800-1945\n", " Mega office\n", " 4-9 floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", - " 11\n", + " 471096\n", + " 144149\n", + " 02064363\n", + " 2030\n", + " 2050\n", + " boulevard Pie-IX (MTL+MTN+SLN)\n", + " 50\n", + " 6000\n", + " Immeuble à bureaux\n", + " Régulier\n", + " 29\n", + " ...\n", + " POLYGON ((-73.54215 45.54976, -73.54201 45.549...\n", + " 1918\n", + " 1.750785\n", + " 0.034483\n", + " POLYGON ((613796.289 5045058.422, 613807.075 5...\n", + " 7301.335267\n", + " 1800-1945\n", + " Mega office\n", + " 4-9 floors\n", + " lod1\n", + " \n", + " \n", + " 472085\n", " 162723\n", - " 1093039\n", + " 01093039\n", " 3725\n", " 3747\n", " rue Saint-Denis (MTL)\n", @@ -2336,21 +2384,21 @@ " Régulier\n", " 45\n", " ...\n", - " POLYGON ((-73.57148967173404 45.51994244675434...\n", + " POLYGON ((-73.57149 45.51994, -73.57147 45.519...\n", " 1885\n", " 1.673016\n", " 0.022222\n", - " POLYGON ((611565.3436088917 5041704.476042462,...\n", + " POLYGON ((611565.344 5041704.476, 611566.649 5...\n", " 7065.295017\n", " 1800-1945\n", " Mega office\n", " 10+ floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", - " 16\n", + " 471086\n", " 134507\n", - " 1031375\n", + " 01031375\n", " 5505\n", " 5505\n", " boulevard Saint-Laurent (MTL)\n", @@ -2360,21 +2408,93 @@ " Régulier\n", " 21\n", " ...\n", - " POLYGON ((-73.5982145816157 45.52638694651501,...\n", + " POLYGON ((-73.59821 45.52639, -73.59820 45.526...\n", " 1903\n", " 2.148360\n", " 0.047619\n", - " POLYGON ((609465.6585284412 5042383.651440187,...\n", + " POLYGON ((609465.659 5042383.651, 609466.736 5...\n", " 4884.011552\n", " 1800-1945\n", " Mega office\n", " 4-9 floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", - " 25\n", + " 409455\n", + " 83039\n", + " 03043402\n", + " 7250\n", + " 7250\n", + " rue Marconi (MTL)\n", + " 50\n", + " 6000\n", + " Immeuble à bureaux\n", + " Régulier\n", + " 17\n", + " ...\n", + " POLYGON ((-73.62166 45.53210, -73.62203 45.532...\n", + " 1941\n", + " 1.611822\n", + " 0.058824\n", + " POLYGON ((607624.013 5042987.071, 607594.312 5...\n", + " 4358.896214\n", + " 1800-1945\n", + " Mega office\n", + " 4-9 floors\n", + " lod1\n", + " \n", + " \n", + " 112625\n", + " 156412\n", + " 05241231\n", + " 1431\n", + " 1431\n", + " rue Fullum (MTL)\n", + " 50\n", + " 6000\n", + " Immeuble à bureaux\n", + " Condominium\n", + " 36\n", + " ...\n", + " POLYGON ((-73.54871 45.52839, -73.54885 45.528...\n", + " 1920\n", + " 1.142879\n", + " 0.027778\n", + " POLYGON ((613327.397 5042674.552, 613316.075 5...\n", + " 3953.598369\n", + " 1800-1945\n", + " Mega office\n", + " 4-9 floors\n", + " lod1\n", + " \n", + " \n", + " 471961\n", + " 118574\n", + " 03078491\n", + " 7035\n", + " 7077\n", + " avenue du Parc (MTL)\n", + " 50\n", + " 6000\n", + " Immeuble à bureaux\n", + " Régulier\n", + " 31\n", + " ...\n", + " POLYGON ((-73.61942 45.53031, -73.62015 45.530...\n", + " 1940\n", + " 1.442995\n", + " 0.032258\n", + " POLYGON ((607802.244 5042791.156, 607744.954 5...\n", + " 3937.447553\n", + " 1800-1945\n", + " Mega office\n", + " 4-9 floors\n", + " lod1\n", + " \n", + " \n", + " 33407\n", " 131897\n", - " 1039182\n", + " 01039182\n", " 1000\n", " 1022\n", " rue Sainte-Catherine Ouest (MTL+WMT)\n", @@ -2384,21 +2504,21 @@ " Régulier\n", " 54\n", " ...\n", - " POLYGON ((-73.5721427650387 45.49979176551065,...\n", + " POLYGON ((-73.57214 45.49979, -73.57161 45.500...\n", " 1937\n", " 1.332875\n", " 0.018519\n", - " POLYGON ((611554.1447597386 5039464.894097178,...\n", + " POLYGON ((611554.145 5039464.894, 611594.441 5...\n", " 3767.206358\n", " 1800-1945\n", " Mega office\n", " 10+ floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", - " 51\n", + " 472941\n", " 176229\n", - " 1045045\n", + " 01045045\n", " 1000\n", " 1000\n", " rue Saint-Antoine Ouest (MTL)\n", @@ -2408,21 +2528,21 @@ " Régulier\n", " 35\n", " ...\n", - " POLYGON ((-73.56513396322417 45.49720581059058...\n", + " POLYGON ((-73.56513 45.49721, -73.56484 45.497...\n", " 1925\n", " 1.577369\n", " 0.028571\n", - " POLYGON ((612106.8518472302 5039187.3624462355...\n", + " POLYGON ((612106.852 5039187.362, 612129.347 5...\n", " 2476.308750\n", " 1800-1945\n", " Mega office\n", " 4-9 floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", - " 54\n", + " 485854\n", " 173143\n", - " 1036696\n", + " 01036696\n", " 360\n", " 360\n", " rue Saint-Jacques (MTL)\n", @@ -2432,21 +2552,21 @@ " Régulier\n", " 119\n", " ...\n", - " POLYGON ((-73.55898286507197 45.50195165560664...\n", + " POLYGON ((-73.55898 45.50195, -73.55870 45.502...\n", " 1928\n", " 1.401016\n", " 0.008403\n", - " POLYGON ((612577.978822547 5039723.213385784, ...\n", + " POLYGON ((612577.979 5039723.213, 612599.333 5...\n", " 2434.504492\n", " 1800-1945\n", " Mega office\n", " 10+ floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", - " 71\n", + " 485175\n", " 175001\n", - " 1000003\n", + " 01000003\n", " 425\n", " 425\n", " avenue Viger Ouest (MTL)\n", @@ -2456,96 +2576,131 @@ " Régulier\n", " 48\n", " ...\n", - " POLYGON ((-73.5629245675038 45.50346814387118,...\n", + " POLYGON ((-73.56292 45.50347, -73.56307 45.503...\n", " 1861\n", " 1.901155\n", " 0.020833\n", - " POLYGON ((612267.0236778263 5039886.172234783,...\n", + " POLYGON ((612267.024 5039886.172, 612256.095 5...\n", " 1961.248656\n", " 1800-1945\n", " Mega office\n", " 10+ floors\n", - " lod_2\n", + " lod1\n", " \n", " \n", "\n", - "

7 rows × 32 columns

\n", + "

12 rows × 32 columns

\n", "" ], "text/plain": [ - " OBJECTID ID_UEV CIVIQUE_DE CIVIQUE_FI \\\n", - "6 152835 5027487 2200 2222 \n", - "11 162723 1093039 3725 3747 \n", - "16 134507 1031375 5505 5505 \n", - "25 131897 1039182 1000 1022 \n", - "51 176229 1045045 1000 1000 \n", - "54 173143 1036696 360 360 \n", - "71 175001 1000003 425 425 \n", + " OBJECTID ID_UEV CIVIQUE_DE CIVIQUE_FI \\\n", + "17013 36076 05030608 4477 5605 \n", + "472072 152835 05027487 2200 2222 \n", + "471096 144149 02064363 2030 2050 \n", + "472085 162723 01093039 3725 3747 \n", + "471086 134507 01031375 5505 5505 \n", + "409455 83039 03043402 7250 7250 \n", + "112625 156412 05241231 1431 1431 \n", + "471961 118574 03078491 7035 7077 \n", + "33407 131897 01039182 1000 1022 \n", + "472941 176229 01045045 1000 1000 \n", + "485854 173143 01036696 360 360 \n", + "485175 175001 01000003 425 425 \n", "\n", - " NOM_RUE MUNICIPALI CODE_UTILI \\\n", - "6 rue Sainte-Catherine Est (MTE+MTL) 50 6000 \n", - "11 rue Saint-Denis (MTL) 50 6000 \n", - "16 boulevard Saint-Laurent (MTL) 50 6000 \n", - "25 rue Sainte-Catherine Ouest (MTL+WMT) 50 6000 \n", - "51 rue Saint-Antoine Ouest (MTL) 50 6000 \n", - "54 rue Saint-Jacques (MTL) 50 6000 \n", - "71 avenue Viger Ouest (MTL) 50 6000 \n", + " NOM_RUE MUNICIPALI CODE_UTILI \\\n", + "17013 boulevard Pie-IX (MTL+MTN+SLN) 50 6000 \n", + "472072 rue Sainte-Catherine Est (MTE+MTL) 50 6000 \n", + "471096 boulevard Pie-IX (MTL+MTN+SLN) 50 6000 \n", + "472085 rue Saint-Denis (MTL) 50 6000 \n", + "471086 boulevard Saint-Laurent (MTL) 50 6000 \n", + "409455 rue Marconi (MTL) 50 6000 \n", + "112625 rue Fullum (MTL) 50 6000 \n", + "471961 avenue du Parc (MTL) 50 6000 \n", + "33407 rue Sainte-Catherine Ouest (MTL+WMT) 50 6000 \n", + "472941 rue Saint-Antoine Ouest (MTL) 50 6000 \n", + "485854 rue Saint-Jacques (MTL) 50 6000 \n", + "485175 avenue Viger Ouest (MTL) 50 6000 \n", "\n", - " LIBELLE_UT CATEGORIE_ Hieght_LiD ... \\\n", - "6 Immeuble à bureaux Régulier 33 ... \n", - "11 Immeuble à bureaux Régulier 45 ... \n", - "16 Immeuble à bureaux Régulier 21 ... \n", - "25 Immeuble à bureaux Régulier 54 ... \n", - "51 Immeuble à bureaux Régulier 35 ... \n", - "54 Immeuble à bureaux Régulier 119 ... \n", - "71 Immeuble à bureaux Régulier 48 ... \n", + " LIBELLE_UT CATEGORIE_ Hieght_LiD ... \\\n", + "17013 Immeuble à bureaux Régulier 20 ... \n", + "472072 Immeuble à bureaux Régulier 33 ... \n", + "471096 Immeuble à bureaux Régulier 29 ... \n", + "472085 Immeuble à bureaux Régulier 45 ... \n", + "471086 Immeuble à bureaux Régulier 21 ... \n", + "409455 Immeuble à bureaux Régulier 17 ... \n", + "112625 Immeuble à bureaux Condominium 36 ... \n", + "471961 Immeuble à bureaux Régulier 31 ... \n", + "33407 Immeuble à bureaux Régulier 54 ... \n", + "472941 Immeuble à bureaux Régulier 35 ... \n", + "485854 Immeuble à bureaux Régulier 119 ... \n", + "485175 Immeuble à bureaux Régulier 48 ... \n", "\n", - " geometry ANNEE_CONS \\\n", - "6 POLYGON ((-73.54820576510775 45.52676864822449... 1930 \n", - "11 POLYGON ((-73.57148967173404 45.51994244675434... 1885 \n", - "16 POLYGON ((-73.5982145816157 45.52638694651501,... 1903 \n", - "25 POLYGON ((-73.5721427650387 45.49979176551065,... 1937 \n", - "51 POLYGON ((-73.56513396322417 45.49720581059058... 1925 \n", - "54 POLYGON ((-73.55898286507197 45.50195165560664... 1928 \n", - "71 POLYGON ((-73.5629245675038 45.50346814387118,... 1861 \n", + " geometry ANNEE_CONS \\\n", + "17013 POLYGON ((-73.56772 45.55916, -73.56775 45.559... 1930 \n", + "472072 POLYGON ((-73.54821 45.52677, -73.54826 45.526... 1930 \n", + "471096 POLYGON ((-73.54215 45.54976, -73.54201 45.549... 1918 \n", + "472085 POLYGON ((-73.57149 45.51994, -73.57147 45.519... 1885 \n", + "471086 POLYGON ((-73.59821 45.52639, -73.59820 45.526... 1903 \n", + "409455 POLYGON ((-73.62166 45.53210, -73.62203 45.532... 1941 \n", + "112625 POLYGON ((-73.54871 45.52839, -73.54885 45.528... 1920 \n", + "471961 POLYGON ((-73.61942 45.53031, -73.62015 45.530... 1940 \n", + "33407 POLYGON ((-73.57214 45.49979, -73.57161 45.500... 1937 \n", + "472941 POLYGON ((-73.56513 45.49721, -73.56484 45.497... 1925 \n", + "485854 POLYGON ((-73.55898 45.50195, -73.55870 45.502... 1928 \n", + "485175 POLYGON ((-73.56292 45.50347, -73.56307 45.503... 1861 \n", "\n", - " New_AspectRatio New_SurfacetoVolumeRatio \\\n", - "6 1.436573 0.030303 \n", - "11 1.673016 0.022222 \n", - "16 2.148360 0.047619 \n", - "25 1.332875 0.018519 \n", - "51 1.577369 0.028571 \n", - "54 1.401016 0.008403 \n", - "71 1.901155 0.020833 \n", + " New_AspectRatio New_SurfacetoVolumeRatio \\\n", + "17013 1.954238 0.050000 \n", + "472072 1.436573 0.030303 \n", + "471096 1.750785 0.034483 \n", + "472085 1.673016 0.022222 \n", + "471086 2.148360 0.047619 \n", + "409455 1.611822 0.058824 \n", + "112625 1.142879 0.027778 \n", + "471961 1.442995 0.032258 \n", + "33407 1.332875 0.018519 \n", + "472941 1.577369 0.028571 \n", + "485854 1.401016 0.008403 \n", + "485175 1.901155 0.020833 \n", "\n", - " transformed_geometry calculated_area \\\n", - "6 POLYGON ((613370.0745799394 5042495.465036549,... 8527.804906 \n", - "11 POLYGON ((611565.3436088917 5041704.476042462,... 7065.295017 \n", - "16 POLYGON ((609465.6585284412 5042383.651440187,... 4884.011552 \n", - "25 POLYGON ((611554.1447597386 5039464.894097178,... 3767.206358 \n", - "51 POLYGON ((612106.8518472302 5039187.3624462355... 2476.308750 \n", - "54 POLYGON ((612577.978822547 5039723.213385784, ... 2434.504492 \n", - "71 POLYGON ((612267.0236778263 5039886.172234783,... 1961.248656 \n", + " transformed_geometry calculated_area \\\n", + "17013 POLYGON ((611782.360 5046066.630, 611779.902 5... 48.162656 \n", + "472072 POLYGON ((613370.075 5042495.465, 613365.907 5... 8527.804906 \n", + "471096 POLYGON ((613796.289 5045058.422, 613807.075 5... 7301.335267 \n", + "472085 POLYGON ((611565.344 5041704.476, 611566.649 5... 7065.295017 \n", + "471086 POLYGON ((609465.659 5042383.651, 609466.736 5... 4884.011552 \n", + "409455 POLYGON ((607624.013 5042987.071, 607594.312 5... 4358.896214 \n", + "112625 POLYGON ((613327.397 5042674.552, 613316.075 5... 3953.598369 \n", + "471961 POLYGON ((607802.244 5042791.156, 607744.954 5... 3937.447553 \n", + "33407 POLYGON ((611554.145 5039464.894, 611594.441 5... 3767.206358 \n", + "472941 POLYGON ((612106.852 5039187.362, 612129.347 5... 2476.308750 \n", + "485854 POLYGON ((612577.979 5039723.213, 612599.333 5... 2434.504492 \n", + "485175 POLYGON ((612267.024 5039886.172, 612256.095 5... 1961.248656 \n", "\n", - " YearGroup Building_Size Building_Floors lod \n", - "6 1800-1945 Mega office 4-9 floors lod_2 \n", - "11 1800-1945 Mega office 10+ floors lod_2 \n", - "16 1800-1945 Mega office 4-9 floors lod_2 \n", - "25 1800-1945 Mega office 10+ floors lod_2 \n", - "51 1800-1945 Mega office 4-9 floors lod_2 \n", - "54 1800-1945 Mega office 10+ floors lod_2 \n", - "71 1800-1945 Mega office 10+ floors lod_2 \n", + " YearGroup Building_Size Building_Floors lod \n", + "17013 1800-1945 Mega office 4-9 floors lod1 \n", + "472072 1800-1945 Mega office 4-9 floors lod1 \n", + "471096 1800-1945 Mega office 4-9 floors lod1 \n", + "472085 1800-1945 Mega office 10+ floors lod1 \n", + "471086 1800-1945 Mega office 4-9 floors lod1 \n", + "409455 1800-1945 Mega office 4-9 floors lod1 \n", + "112625 1800-1945 Mega office 4-9 floors lod1 \n", + "471961 1800-1945 Mega office 4-9 floors lod1 \n", + "33407 1800-1945 Mega office 10+ floors lod1 \n", + "472941 1800-1945 Mega office 4-9 floors lod1 \n", + "485854 1800-1945 Mega office 10+ floors lod1 \n", + "485175 1800-1945 Mega office 10+ floors lod1 \n", "\n", - "[7 rows x 32 columns]" + "[12 rows x 32 columns]" ] }, - "execution_count": 48, + "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "lod2_buildings_dict['detached']['1800-1945']['Mega Office']" + "lod1_buildings_dict['detached']['1800-1945']['Mega Office']" ] }, { @@ -2589,7 +2744,7 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 71, "metadata": {}, "outputs": [ { @@ -2642,7 +2797,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 76, "metadata": {}, "outputs": [ { @@ -2677,61 +2832,17 @@ " \n", " \n", " \n", - " \n", - " 0\n", - " 01125630\n", - " 1190\n", - " 1190\n", - " avenue des Canadiens-de-Montréal (MTL)\n", - " 361057\n", - " 11644.077457\n", - " 10+ floors\n", - " NaN\n", - " \n", - " \n", - " 1\n", - " 05027512\n", - " 2600\n", - " 2600\n", - " boulevard Alfred-Nobel (SLR)\n", - " 23030\n", - " 3288.543644\n", - " 4-9 floors\n", - " NaN\n", - " \n", - " \n", - " 2\n", - " 04155350\n", - " 8275\n", - " 8275\n", - " autoroute Transcanadienne (BCF+BDU+DVL+KRK+MT...\n", - " 58260\n", - " 11647.439141\n", - " 4-9 floors\n", - " NaN\n", - " \n", " \n", "\n", "" ], "text/plain": [ - " ID_UEV CIVIQUE_DE CIVIQUE_FI \\\n", - "0 01125630 1190 1190 \n", - "1 05027512 2600 2600 \n", - "2 04155350 8275 8275 \n", - "\n", - " NOM_RUE TotalFloorArea \\\n", - "0 avenue des Canadiens-de-Montréal (MTL) 361057 \n", - "1 boulevard Alfred-Nobel (SLR) 23030 \n", - "2 autoroute Transcanadienne (BCF+BDU+DVL+KRK+MT... 58260 \n", - "\n", - " calculated_area Building_Floors lod \n", - "0 11644.077457 10+ floors NaN \n", - "1 3288.543644 4-9 floors NaN \n", - "2 11647.439141 4-9 floors NaN " + "Empty DataFrame\n", + "Columns: [ID_UEV, CIVIQUE_DE, CIVIQUE_FI, NOM_RUE, TotalFloorArea, calculated_area, Building_Floors, lod]\n", + "Index: []" ] }, - "execution_count": 54, + "execution_count": 76, "metadata": {}, "output_type": "execute_result" } @@ -2745,7 +2856,7 @@ " 'Mega Office': (18581, float('inf'))\n", "}\n", "\n", - "sampled_buildings_dict['detached']['2011-2024']['Mega Office'][['ID_UEV','CIVIQUE_DE','CIVIQUE_FI','NOM_RUE','TotalFloorArea','calculated_area','Building_Floors','lod']] \n", + "sampled_buildings_dict['detached']['2011-2024']['Single-Use Office'][['ID_UEV','CIVIQUE_DE','CIVIQUE_FI','NOM_RUE','TotalFloorArea','calculated_area','Building_Floors','lod']] \n", " " ] }, diff --git a/EDA.ipynb b/EDA.ipynb index 60a35fa..2a29783 100644 --- a/EDA.ipynb +++ b/EDA.ipynb @@ -514,7 +514,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.9.5" } }, "nbformat": 4,