|
21 | 21 | { |
22 | 22 | "cell_type": "code", |
23 | 23 | "execution_count": null, |
24 | | - "metadata": {}, |
| 24 | + "metadata": { |
| 25 | + "execution": { |
| 26 | + "iopub.execute_input": "2026-01-23T19:12:53.231018Z", |
| 27 | + "iopub.status.busy": "2026-01-23T19:12:53.230906Z", |
| 28 | + "iopub.status.idle": "2026-01-23T19:12:54.153805Z", |
| 29 | + "shell.execute_reply": "2026-01-23T19:12:54.153202Z" |
| 30 | + } |
| 31 | + }, |
25 | 32 | "outputs": [], |
26 | 33 | "source": [ |
27 | 34 | "import datashader as ds\n", |
|
60 | 67 | { |
61 | 68 | "cell_type": "code", |
62 | 69 | "execution_count": null, |
63 | | - "metadata": {}, |
| 70 | + "metadata": { |
| 71 | + "execution": { |
| 72 | + "iopub.execute_input": "2026-01-23T19:12:54.155318Z", |
| 73 | + "iopub.status.busy": "2026-01-23T19:12:54.155027Z", |
| 74 | + "iopub.status.idle": "2026-01-23T19:12:54.308338Z", |
| 75 | + "shell.execute_reply": "2026-01-23T19:12:54.307765Z" |
| 76 | + } |
| 77 | + }, |
64 | 78 | "outputs": [], |
65 | 79 | "source": [ |
66 | 80 | "# Load Pharmacies and add out x, y fields based on CalcLocation\n", |
67 | | - "pharmacy_df = pd.read_csv(\"./xrspatial-examples/data/facilities.csv\")\n", |
| 81 | + "pharmacy_df = pd.read_csv(\"../xrspatial-examples/data/facilities.csv\")\n", |
68 | 82 | "coords = pharmacy_df[\"CalcLocation\"].str.split(\",\", expand=True)\n", |
69 | 83 | "pharmacy_df[\"y\"] = np.array(coords[0], dtype=\"float64\")\n", |
70 | 84 | "pharmacy_df[\"x\"] = np.array(coords[1], dtype=\"float64\")\n", |
|
82 | 96 | { |
83 | 97 | "cell_type": "code", |
84 | 98 | "execution_count": null, |
85 | | - "metadata": {}, |
| 99 | + "metadata": { |
| 100 | + "execution": { |
| 101 | + "iopub.execute_input": "2026-01-23T19:12:54.325729Z", |
| 102 | + "iopub.status.busy": "2026-01-23T19:12:54.325568Z", |
| 103 | + "iopub.status.idle": "2026-01-23T19:13:07.768006Z", |
| 104 | + "shell.execute_reply": "2026-01-23T19:13:07.767388Z" |
| 105 | + } |
| 106 | + }, |
86 | 107 | "outputs": [], |
87 | 108 | "source": [ |
88 | 109 | "# Load Census Block Groups and Calculate Percent over 65 years-old\n", |
|
105 | 126 | { |
106 | 127 | "cell_type": "code", |
107 | 128 | "execution_count": null, |
108 | | - "metadata": {}, |
| 129 | + "metadata": { |
| 130 | + "execution": { |
| 131 | + "iopub.execute_input": "2026-01-23T19:13:07.769550Z", |
| 132 | + "iopub.status.busy": "2026-01-23T19:13:07.769287Z", |
| 133 | + "iopub.status.idle": "2026-01-23T19:13:08.942658Z", |
| 134 | + "shell.execute_reply": "2026-01-23T19:13:08.941968Z" |
| 135 | + } |
| 136 | + }, |
109 | 137 | "outputs": [], |
110 | 138 | "source": [ |
111 | 139 | "# Load Census County and Calculate Percent over 65 years-old\n", |
|
140 | 168 | { |
141 | 169 | "cell_type": "code", |
142 | 170 | "execution_count": null, |
143 | | - "metadata": {}, |
| 171 | + "metadata": { |
| 172 | + "execution": { |
| 173 | + "iopub.execute_input": "2026-01-23T19:13:08.944030Z", |
| 174 | + "iopub.status.busy": "2026-01-23T19:13:08.943925Z", |
| 175 | + "iopub.status.idle": "2026-01-23T19:13:12.446986Z", |
| 176 | + "shell.execute_reply": "2026-01-23T19:13:12.446334Z" |
| 177 | + } |
| 178 | + }, |
144 | 179 | "outputs": [], |
145 | 180 | "source": [ |
146 | 181 | "x_range = (-124.848974, -66.885444)\n", |
|
176 | 211 | { |
177 | 212 | "cell_type": "code", |
178 | 213 | "execution_count": null, |
179 | | - "metadata": {}, |
| 214 | + "metadata": { |
| 215 | + "execution": { |
| 216 | + "iopub.execute_input": "2026-01-23T19:13:12.448188Z", |
| 217 | + "iopub.status.busy": "2026-01-23T19:13:12.448083Z", |
| 218 | + "iopub.status.idle": "2026-01-23T19:13:15.042708Z", |
| 219 | + "shell.execute_reply": "2026-01-23T19:13:15.042222Z" |
| 220 | + } |
| 221 | + }, |
180 | 222 | "outputs": [], |
181 | 223 | "source": [ |
182 | 224 | "pharmacy_raster = cvs.points(pharmacy_df, \"x\", \"y\")\n", |
|
205 | 247 | { |
206 | 248 | "cell_type": "code", |
207 | 249 | "execution_count": null, |
208 | | - "metadata": {}, |
| 250 | + "metadata": { |
| 251 | + "execution": { |
| 252 | + "iopub.execute_input": "2026-01-23T19:13:15.044150Z", |
| 253 | + "iopub.status.busy": "2026-01-23T19:13:15.044043Z", |
| 254 | + "iopub.status.idle": "2026-01-23T19:13:23.087968Z", |
| 255 | + "shell.execute_reply": "2026-01-23T19:13:23.087515Z" |
| 256 | + } |
| 257 | + }, |
209 | 258 | "outputs": [], |
210 | 259 | "source": [ |
211 | 260 | "age_raster = cvs.polygons(\n", |
|
232 | 281 | { |
233 | 282 | "cell_type": "code", |
234 | 283 | "execution_count": null, |
235 | | - "metadata": {}, |
| 284 | + "metadata": { |
| 285 | + "execution": { |
| 286 | + "iopub.execute_input": "2026-01-23T19:13:23.090108Z", |
| 287 | + "iopub.status.busy": "2026-01-23T19:13:23.090002Z", |
| 288 | + "iopub.status.idle": "2026-01-23T19:13:23.469051Z", |
| 289 | + "shell.execute_reply": "2026-01-23T19:13:23.468423Z" |
| 290 | + } |
| 291 | + }, |
236 | 292 | "outputs": [], |
237 | 293 | "source": [ |
238 | 294 | "pharmacy_deserts = binary(proximity_classifed, [3])\n", |
|
267 | 323 | { |
268 | 324 | "cell_type": "code", |
269 | 325 | "execution_count": null, |
270 | | - "metadata": {}, |
| 326 | + "metadata": { |
| 327 | + "execution": { |
| 328 | + "iopub.execute_input": "2026-01-23T19:13:23.470503Z", |
| 329 | + "iopub.status.busy": "2026-01-23T19:13:23.470395Z", |
| 330 | + "iopub.status.idle": "2026-01-23T19:13:25.284662Z", |
| 331 | + "shell.execute_reply": "2026-01-23T19:13:25.284119Z" |
| 332 | + } |
| 333 | + }, |
271 | 334 | "outputs": [], |
272 | 335 | "source": [ |
273 | 336 | "from datashader.colors import Set1\n", |
|
294 | 357 | { |
295 | 358 | "cell_type": "code", |
296 | 359 | "execution_count": null, |
297 | | - "metadata": {}, |
| 360 | + "metadata": { |
| 361 | + "execution": { |
| 362 | + "iopub.execute_input": "2026-01-23T19:13:25.286041Z", |
| 363 | + "iopub.status.busy": "2026-01-23T19:13:25.285949Z", |
| 364 | + "iopub.status.idle": "2026-01-23T19:13:25.470420Z", |
| 365 | + "shell.execute_reply": "2026-01-23T19:13:25.469864Z" |
| 366 | + } |
| 367 | + }, |
298 | 368 | "outputs": [], |
299 | 369 | "source": [ |
300 | 370 | "from xrspatial import zonal_stats\n", |
|
322 | 392 | { |
323 | 393 | "cell_type": "code", |
324 | 394 | "execution_count": null, |
325 | | - "metadata": {}, |
| 395 | + "metadata": { |
| 396 | + "execution": { |
| 397 | + "iopub.execute_input": "2026-01-23T19:13:25.471583Z", |
| 398 | + "iopub.status.busy": "2026-01-23T19:13:25.471478Z", |
| 399 | + "iopub.status.idle": "2026-01-23T19:13:25.593109Z", |
| 400 | + "shell.execute_reply": "2026-01-23T19:13:25.592471Z" |
| 401 | + } |
| 402 | + }, |
326 | 403 | "outputs": [], |
327 | 404 | "source": [ |
328 | 405 | "cols = [\"pharmacy_desert_mean\", \"NAME\", \"STATE_FIPS\", \"geometry\"]\n", |
|
340 | 417 | { |
341 | 418 | "cell_type": "code", |
342 | 419 | "execution_count": null, |
343 | | - "metadata": {}, |
| 420 | + "metadata": { |
| 421 | + "execution": { |
| 422 | + "iopub.execute_input": "2026-01-23T19:13:25.594252Z", |
| 423 | + "iopub.status.busy": "2026-01-23T19:13:25.594151Z", |
| 424 | + "iopub.status.idle": "2026-01-23T19:13:28.338669Z", |
| 425 | + "shell.execute_reply": "2026-01-23T19:13:28.337777Z" |
| 426 | + } |
| 427 | + }, |
344 | 428 | "outputs": [], |
345 | 429 | "source": [ |
346 | 430 | "from xrspatial import hillshade\n", |
|
359 | 443 | { |
360 | 444 | "cell_type": "code", |
361 | 445 | "execution_count": null, |
362 | | - "metadata": {}, |
| 446 | + "metadata": { |
| 447 | + "execution": { |
| 448 | + "iopub.execute_input": "2026-01-23T19:13:28.340196Z", |
| 449 | + "iopub.status.busy": "2026-01-23T19:13:28.340077Z", |
| 450 | + "iopub.status.idle": "2026-01-23T19:13:28.571855Z", |
| 451 | + "shell.execute_reply": "2026-01-23T19:13:28.571307Z" |
| 452 | + } |
| 453 | + }, |
363 | 454 | "outputs": [], |
364 | 455 | "source": [ |
365 | 456 | "img = stack(\n", |
|
370 | 461 | ")\n", |
371 | 462 | "set_background(img, \"black\")" |
372 | 463 | ] |
| 464 | + }, |
| 465 | + { |
| 466 | + "cell_type": "code", |
| 467 | + "execution_count": null, |
| 468 | + "metadata": {}, |
| 469 | + "outputs": [], |
| 470 | + "source": [] |
373 | 471 | } |
374 | 472 | ], |
375 | 473 | "metadata": { |
| 474 | + "kernelspec": { |
| 475 | + "display_name": "Python 3 (ipykernel)", |
| 476 | + "language": "python", |
| 477 | + "name": "python3" |
| 478 | + }, |
376 | 479 | "language_info": { |
377 | | - "name": "python" |
| 480 | + "codemirror_mode": { |
| 481 | + "name": "ipython", |
| 482 | + "version": 3 |
| 483 | + }, |
| 484 | + "file_extension": ".py", |
| 485 | + "mimetype": "text/x-python", |
| 486 | + "name": "python", |
| 487 | + "nbconvert_exporter": "python", |
| 488 | + "pygments_lexer": "ipython3", |
| 489 | + "version": "3.14.2" |
378 | 490 | } |
379 | 491 | }, |
380 | 492 | "nbformat": 4, |
|
0 commit comments