Skip to content

Commit 6fc4f4d

Browse files
committed
Merge 'upstream/master' into jy-release-notes185
2 parents 5d60f42 + 1e1582e commit 6fc4f4d

13 files changed

+7407
-4362
lines changed

guide/14-deep-learning/dl-on-time-series-data.ipynb

Lines changed: 296 additions & 0 deletions
Large diffs are not rendered by default.

guide/14-deep-learning/utilize_multiple_gpus_to_train_model.ipynb

Lines changed: 267 additions & 0 deletions
Large diffs are not rendered by default.

items_metadata.yaml

Lines changed: 412 additions & 376 deletions
Large diffs are not rendered by default.

samples/04_gis_analysts_data_scientists/analyzing_growth_factors_of_airbnb_properties_in_new_york_city.ipynb

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"import matplotlib.pyplot as plt\n",
6666
"\n",
6767
"\n",
68-
"from datetime import datetime\n",
68+
"from datetime import datetime as dt\n",
6969
"import pandas as pd\n",
7070
"import numpy as np\n",
7171
"from IPython.display import display, HTML\n",
@@ -728,7 +728,7 @@
728728
"source": [
729729
"agg_result = summarize_data.aggregate_points(point_layer=airbnb_layer,\n",
730730
" polygon_layer=nyc_tracts_layer,\n",
731-
" output_name='airbnb_counts'+ str(datetime.now().microsecond))"
731+
" output_name='airbnb_counts'+ str(dt.now().microsecond))"
732732
]
733733
},
734734
{
@@ -1676,7 +1676,7 @@
16761676
"# Data Enriching operation\n",
16771677
"airbnb_count_by_tract_enriched = enrich_layer(airbnb_count_by_tract,\n",
16781678
" analysis_variables = variable_names,\n",
1679-
" output_name='airbnb_tract_enrich1'+ str(datetime.now().microsecond))"
1679+
" output_name='airbnb_tract_enrich1'+ str(dt.now().microsecond))"
16801680
]
16811681
},
16821682
{
@@ -4285,7 +4285,7 @@
42854285
" hotels_lyr,\n",
42864286
" measurement_type='StraightLine',\n",
42874287
" max_count=1,\n",
4288-
" output_name='ny_tract_hotel_dist1' + str(datetime.now().microsecond))"
4288+
" output_name='ny_tract_hotel_dist1' + str(dt.now().microsecond))"
42894289
]
42904290
},
42914291
{
@@ -5152,8 +5152,8 @@
51525152
"source": [
51535153
"# Final hotel Distances in feet — Here in each row column \"hotel_dist\" returns the distance of the nearest hotel from that tract indicated by its geoids.\n",
51545154
"# For example in the first row the tract with ID 36005000100 has a nearest hotel at 5571.75 feet away from it. \n",
5155-
"sdf_tract_hotel_dist_lyr_new = sdf_tract_hotel_dist_lyr[['From_geoid', 'Total_Miles']]\n",
5156-
"sdf_tract_hotel_dist_lyr_new['hotel_dist'] = round(sdf_tract_hotel_dist_lyr_new['Total_Miles'] * 5280, 2)\n",
5155+
"sdf_tract_hotel_dist_lyr_new = sdf_tract_hotel_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
5156+
"sdf_tract_hotel_dist_lyr_new['hotel_dist'] = round(sdf_tract_hotel_dist_lyr_new['Total_Kilometers'] * 3280.84, 2)\n",
51575157
"sdf_tract_hotel_dist_lyr_new.sort_values('From_geoid').head()"
51585158
]
51595159
},
@@ -5168,9 +5168,9 @@
51685168
" bus_stop_lyr,\n",
51695169
" measurement_type='StraightLine',\n",
51705170
" max_count=1,\n",
5171-
" output_name='ny_tract_bus_stop_dist'+ str(datetime.now().microsecond))\n",
5171+
" output_name='ny_tract_bus_stop_dist'+ str(dt.now().microsecond))\n",
51725172
"tract_bustop_dist_lyr = tract_bustop_dist.layers[1]\n",
5173-
"sdf_tract_bustop_dist_lyr = pd.DataFrame.spatial.from_layer(tract_bustop_dist_lyr)"
5173+
"sdf_tract_bustop_dist_lyr =tract_bustop_dist_lyr.query().sdf"
51745174
]
51755175
},
51765176
{
@@ -5256,8 +5256,8 @@
52565256
"source": [
52575257
"# Final Bustop Distances in feet — Here in each row column \"busstop_dist\" returns the distance of the nearest bus stop \n",
52585258
"# from that tract indicated by its geoids \n",
5259-
"sdf_tract_bustop_dist_lyr_new = sdf_tract_bustop_dist_lyr[['From_geoid', 'Total_Miles']]\n",
5260-
"sdf_tract_bustop_dist_lyr_new['busstop_dist'] = round(sdf_tract_bustop_dist_lyr_new['Total_Miles'] * 5280)\n",
5259+
"sdf_tract_bustop_dist_lyr_new = sdf_tract_bustop_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
5260+
"sdf_tract_bustop_dist_lyr_new['busstop_dist'] = round(sdf_tract_bustop_dist_lyr_new['Total_Kilometers'] * 3280.84, 2)\n",
52615261
"sdf_tract_bustop_dist_lyr_new.sort_values('From_geoid').head()"
52625262
]
52635263
},
@@ -5270,7 +5270,7 @@
52705270
"# estimating number of bus stops per tract\n",
52715271
"num_bustops_tracts = summarize_data.aggregate_points(point_layer=bus_stop_lyr,\n",
52725272
" polygon_layer=nyc_tracts_layer,\n",
5273-
" output_name='bustops_by_tracts'+ str(datetime.now().microsecond)) "
5273+
" output_name='bustops_by_tracts'+ str(dt.now().microsecond)) "
52745274
]
52755275
},
52765276
{
@@ -5847,9 +5847,9 @@
58475847
" cbd_lyr,\n",
58485848
" measurement_type='StraightLine',\n",
58495849
" max_count=1,\n",
5850-
" output_name='ny_tract_cbd_dist'+ str(datetime.now().microsecond))\n",
5850+
" output_name='ny_tract_cbd_dist'+ str(dt.now().microsecond))\n",
58515851
"tract_cbd_dist_lyr = tract_cbd_dist.layers[1]\n",
5852-
"sdf_tract_cbd_dist_lyr = pd.DataFrame.spatial.from_layer(tract_cbd_dist_lyr)\n",
5852+
"sdf_tract_cbd_dist_lyr = tract_cbd_dist_lyr.query().sdf\n",
58535853
"sdf_tract_cbd_dist_lyr.head()"
58545854
]
58555855
},
@@ -5935,8 +5935,8 @@
59355935
],
59365936
"source": [
59375937
"# Final CBD distances in feet — Here in each row the column \"cbd_dst\" returns the distance of the CBD from respective tracts\n",
5938-
"sdf_tract_cbd_dist_lyr_new = sdf_tract_cbd_dist_lyr[['From_geoid', 'Total_Miles']]\n",
5939-
"sdf_tract_cbd_dist_lyr_new['cbd_dist'] = round(sdf_tract_cbd_dist_lyr_new['Total_Miles'] * 5280, 2) \n",
5938+
"sdf_tract_cbd_dist_lyr_new = sdf_tract_cbd_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
5939+
"sdf_tract_cbd_dist_lyr_new['cbd_dist'] = round(sdf_tract_cbd_dist_lyr_new['Total_Kilometers'] * 3280.84, 2) \n",
59405940
"sdf_tract_cbd_dist_lyr_new.sort_values('From_geoid').head()"
59415941
]
59425942
},
@@ -6200,7 +6200,7 @@
62006200
" subwy_stn_lyr,\n",
62016201
" measurement_type='StraightLine',\n",
62026202
" max_count=1,\n",
6203-
" output_name='ny_tract_subway_station_dist'+ str(datetime.now().microsecond))\n",
6203+
" output_name='ny_tract_subway_station_dist'+ str(dt.now().microsecond))\n",
62046204
"tract_subwy_stn_dist_lyr = tract_subwy_stn_dist.layers[1]\n",
62056205
"sdf_tract_subwy_stn_dist_lyr = pd.DataFrame.spatial.from_layer(tract_subwy_stn_dist_lyr)\n",
62066206
"sdf_tract_subwy_stn_dist_lyr.head()"
@@ -6289,8 +6289,8 @@
62896289
"source": [
62906290
"# Final Tract to NYC Subway Station distances in feet — Here in each row, column \"subwy_stn_dist\" returns the distance of\n",
62916291
"# the nearest subway station from that tract\n",
6292-
"sdf_tract_subwy_stn_dist_lyr_new = sdf_tract_subwy_stn_dist_lyr[['From_geoid', 'Total_Miles']]\n",
6293-
"sdf_tract_subwy_stn_dist_lyr_new['subwy_stn_dist'] = round(sdf_tract_subwy_stn_dist_lyr_new['Total_Miles'] * 5280, 2) \n",
6292+
"sdf_tract_subwy_stn_dist_lyr_new = sdf_tract_subwy_stn_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
6293+
"sdf_tract_subwy_stn_dist_lyr_new['subwy_stn_dist'] = round(sdf_tract_subwy_stn_dist_lyr_new['Total_Kilometers'] * 3280.84, 2) \n",
62946294
"sdf_tract_subwy_stn_dist_lyr_new.sort_values('From_geoid').head()"
62956295
]
62966296
},
@@ -6547,9 +6547,9 @@
65476547
" subwy_rt_lyr,\n",
65486548
" measurement_type='StraightLine',\n",
65496549
" max_count=1,\n",
6550-
" output_name='ny_tract_subway_routes_dist'+ str(datetime.now().microsecond))\n",
6550+
" output_name='ny_tract_subway_routes_dist'+ str(dt.now().microsecond))\n",
65516551
"tract_subwy_rt_dist_lyr = tract_subwy_rt_dist.layers[1]\n",
6552-
"sdf_tract_subwy_rt_dist_lyr = pd.DataFrame.spatial.from_layer(tract_subwy_rt_dist_lyr)\n",
6552+
"sdf_tract_subwy_rt_dist_lyr = tract_subwy_rt_dist_lyr.query().sdf\n",
65536553
"sdf_tract_subwy_rt_dist_lyr.head()"
65546554
]
65556555
},
@@ -6636,8 +6636,8 @@
66366636
"source": [
66376637
"# Final Tract to NYCSubwayRoutes distances in feet — Here in each row, column \"subwy_rt_dist\" returns the distance of\n",
66386638
"# the nearest subway route from that tract\n",
6639-
"sdf_tract_subwy_rt_dist_lyr_new = sdf_tract_subwy_rt_dist_lyr[['From_geoid', 'Total_Miles']]\n",
6640-
"sdf_tract_subwy_rt_dist_lyr_new['subwy_rt_dist'] = round(sdf_tract_subwy_rt_dist_lyr_new['Total_Miles'] * 5280) \n",
6639+
"sdf_tract_subwy_rt_dist_lyr_new = sdf_tract_subwy_rt_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
6640+
"sdf_tract_subwy_rt_dist_lyr_new['subwy_rt_dist'] = round(sdf_tract_subwy_rt_dist_lyr_new['Total_Kilometers'] * 3280.84, 2) \n",
66416641
"sdf_tract_subwy_rt_dist_lyr_new.sort_values('From_geoid').head()"
66426642
]
66436643
},
@@ -6869,7 +6869,7 @@
68696869
" railroad_lyr,\n",
68706870
" measurement_type='StraightLine',\n",
68716871
" max_count=1,\n",
6872-
" output_name='tract_railroad_dist'+ str(datetime.now().microsecond))\n",
6872+
" output_name='tract_railroad_dist'+ str(dt.now().microsecond))\n",
68736873
"tract_railroad_dist_lyr = tract_railroad_dist.layers[1]\n",
68746874
"sdf_tract_railroad_dist_lyr = pd.DataFrame.spatial.from_layer(tract_railroad_dist_lyr)\n",
68756875
"sdf_tract_railroad_dist_lyr.head()"
@@ -6958,8 +6958,8 @@
69586958
"source": [
69596959
"# Final Tract to NYCRailroad distances in feet — Here in each row, column \"railroad_dist\" returns the distance of\n",
69606960
"# the nearest rail road route from that tract\n",
6961-
"sdf_tract_railroad_dist_lyr_new = sdf_tract_railroad_dist_lyr[['From_geoid', 'Total_Miles']]\n",
6962-
"sdf_tract_railroad_dist_lyr_new['railroad_dist'] = round(sdf_tract_railroad_dist_lyr_new['Total_Miles'] * 5280, 2) \n",
6961+
"sdf_tract_railroad_dist_lyr_new = sdf_tract_railroad_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
6962+
"sdf_tract_railroad_dist_lyr_new['railroad_dist'] = round(sdf_tract_railroad_dist_lyr_new['Total_Kilometers'] * 3280.84, 2) \n",
69636963
"sdf_tract_railroad_dist_lyr_new.sort_values('From_geoid').head()"
69646964
]
69656965
},
@@ -7259,7 +7259,7 @@
72597259
" busi_distrs_lyr,\n",
72607260
" measurement_type='StraightLine',\n",
72617261
" max_count=1,\n",
7262-
" output_name='tract_busi_distrs_dist'+ str(datetime.now().microsecond))\n",
7262+
" output_name='tract_busi_distrs_dist'+ str(dt.now().microsecond))\n",
72637263
"tract_busi_distrs_dist_lyr = tract_busi_distrs_dist.layers[1]\n",
72647264
"sdf_tract_busi_distrs_dist_lyr = pd.DataFrame.spatial.from_layer(tract_busi_distrs_dist_lyr)\n",
72657265
"sdf_tract_busi_distrs_dist_lyr.head()"
@@ -7347,8 +7347,8 @@
73477347
],
73487348
"source": [
73497349
"# Final Tract to NYC Businesss Districts distances in feet — Here in each row, column \"busi_distr_dist\" returns the distance of the CBD from respective tracts\n",
7350-
"sdf_tract_busi_distrs_dist_lyr_new = sdf_tract_busi_distrs_dist_lyr[['From_geoid', 'Total_Miles']]\n",
7351-
"sdf_tract_busi_distrs_dist_lyr_new['busi_distr_dist'] = round(sdf_tract_busi_distrs_dist_lyr_new['Total_Miles'] * 5280, 2) \n",
7350+
"sdf_tract_busi_distrs_dist_lyr_new = sdf_tract_busi_distrs_dist_lyr[['From_geoid', 'Total_Kilometers']]\n",
7351+
"sdf_tract_busi_distrs_dist_lyr_new['busi_distr_dist'] = round(sdf_tract_busi_distrs_dist_lyr_new['Total_Kilometers'] * 3280.84, 2) \n",
73527352
"sdf_tract_busi_distrs_dist_lyr_new.sort_values('From_geoid').head()"
73537353
]
73547354
},
@@ -8166,9 +8166,7 @@
81668166
" 'ID',\n",
81678167
" 'OBJECTID',\n",
81688168
" 'Point_Count',\n",
8169-
" 'SHAPE',\n",
8170-
" 'Shape__Area',\n",
8171-
" 'Shape__Length',\n",
8169+
" 'SHAPE', \n",
81728170
" 'aggregationMethod',\n",
81738171
" 'aland',\n",
81748172
" 'apportionmentConfidence',\n",
@@ -10439,7 +10437,7 @@
1043910437
"# plotting the actual observed vs predicted airbnb properties by tract\n",
1044010438
"plt.figure(figsize = [25,12])\n",
1044110439
"sns.set(style = 'whitegrid')\n",
10442-
"sns.lineplot(data = y_test_df, markers=True, hue=\"logic\") \n",
10440+
"sns.lineplot(data = y_test_df, markers=True) \n",
1044310441
"\n",
1044410442
"#label the plot\n",
1044510443
"plt.xlabel('Tract ID', fontsize=15)\n",
@@ -10519,9 +10517,9 @@
1051910517
"notebookRuntimeVersion": "4.0"
1052010518
},
1052110519
"kernelspec": {
10522-
"display_name": "Python 3",
10520+
"display_name": "pro28_DL18FebA",
1052310521
"language": "python",
10524-
"name": "python3"
10522+
"name": "pro28_dl18feba"
1052510523
},
1052610524
"language_info": {
1052710525
"codemirror_mode": {
@@ -10533,7 +10531,7 @@
1053310531
"name": "python",
1053410532
"nbconvert_exporter": "python",
1053510533
"pygments_lexer": "ipython3",
10536-
"version": "3.6.8"
10534+
"version": "3.7.9"
1053710535
}
1053810536
},
1053910537
"nbformat": 4,

samples/04_gis_analysts_data_scientists/automate_building_footprint_extraction_using_instance_segmentation.ipynb

Lines changed: 117 additions & 262 deletions
Large diffs are not rendered by default.

samples/04_gis_analysts_data_scientists/finding_a_new_home.ipynb

Lines changed: 1004 additions & 3489 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)