|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "removable-requirement", |
| 5 | + "id": "partial-senate", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# Saving and sharing your NumPy arrays\n", |
|
37 | 37 | { |
38 | 38 | "cell_type": "code", |
39 | 39 | "execution_count": 1, |
40 | | - "id": "chicken-australian", |
| 40 | + "id": "guilty-portal", |
41 | 41 | "metadata": {}, |
42 | 42 | "outputs": [], |
43 | 43 | "source": [ |
|
46 | 46 | }, |
47 | 47 | { |
48 | 48 | "cell_type": "markdown", |
49 | | - "id": "limited-astrology", |
| 49 | + "id": "reasonable-serbia", |
50 | 50 | "metadata": {}, |
51 | 51 | "source": [ |
52 | 52 | "In this tutorial, you will use the following Python, IPython magic, and NumPy functions:\n", |
|
64 | 64 | }, |
65 | 65 | { |
66 | 66 | "cell_type": "markdown", |
67 | | - "id": "loose-revolution", |
| 67 | + "id": "stable-hotel", |
68 | 68 | "metadata": {}, |
69 | 69 | "source": [ |
70 | 70 | "---\n", |
|
81 | 81 | { |
82 | 82 | "cell_type": "code", |
83 | 83 | "execution_count": 2, |
84 | | - "id": "functional-training", |
| 84 | + "id": "russian-contributor", |
85 | 85 | "metadata": {}, |
86 | 86 | "outputs": [ |
87 | 87 | { |
|
102 | 102 | }, |
103 | 103 | { |
104 | 104 | "cell_type": "markdown", |
105 | | - "id": "ancient-submission", |
| 105 | + "id": "following-starter", |
106 | 106 | "metadata": {}, |
107 | 107 | "source": [ |
108 | 108 | "## Save your arrays with NumPy's [`savez`](https://numpy.org/doc/stable/reference/generated/numpy.savez.html?highlight=savez#numpy.savez)\n", |
|
125 | 125 | { |
126 | 126 | "cell_type": "code", |
127 | 127 | "execution_count": 3, |
128 | | - "id": "allied-district", |
| 128 | + "id": "laughing-contest", |
129 | 129 | "metadata": {}, |
130 | 130 | "outputs": [], |
131 | 131 | "source": [ |
|
134 | 134 | }, |
135 | 135 | { |
136 | 136 | "cell_type": "markdown", |
137 | | - "id": "sonic-roller", |
| 137 | + "id": "weekly-climate", |
138 | 138 | "metadata": {}, |
139 | 139 | "source": [ |
140 | 140 | "## Remove the saved arrays and load them back with NumPy's [`load`](https://numpy.org/doc/stable/reference/generated/numpy.load.html#numpy.load)\n", |
|
159 | 159 | { |
160 | 160 | "cell_type": "code", |
161 | 161 | "execution_count": 4, |
162 | | - "id": "center-climate", |
| 162 | + "id": "frozen-superintendent", |
163 | 163 | "metadata": {}, |
164 | 164 | "outputs": [], |
165 | 165 | "source": [ |
|
169 | 169 | { |
170 | 170 | "cell_type": "code", |
171 | 171 | "execution_count": 5, |
172 | | - "id": "friendly-newton", |
| 172 | + "id": "minor-roots", |
173 | 173 | "metadata": {}, |
174 | 174 | "outputs": [ |
175 | 175 | { |
|
189 | 189 | { |
190 | 190 | "cell_type": "code", |
191 | 191 | "execution_count": 6, |
192 | | - "id": "small-mandate", |
| 192 | + "id": "responsible-steps", |
193 | 193 | "metadata": {}, |
194 | 194 | "outputs": [ |
195 | 195 | { |
|
209 | 209 | { |
210 | 210 | "cell_type": "code", |
211 | 211 | "execution_count": 7, |
212 | | - "id": "lyric-indianapolis", |
| 212 | + "id": "gorgeous-skating", |
213 | 213 | "metadata": {}, |
214 | 214 | "outputs": [ |
215 | 215 | { |
|
218 | 218 | "text": [ |
219 | 219 | "Variable Type Data/Info\n", |
220 | 220 | "-------------------------------\n", |
221 | | - "load_xy NpzFile <numpy.lib.npyio.NpzFile <...>object at 0x7f7e58e6fee0>\n", |
| 221 | + "load_xy NpzFile <numpy.lib.npyio.NpzFile <...>object at 0x7fb183f7b970>\n", |
222 | 222 | "np module <module 'numpy' from '/ho<...>kages/numpy/__init__.py'>\n" |
223 | 223 | ] |
224 | 224 | } |
|
229 | 229 | }, |
230 | 230 | { |
231 | 231 | "cell_type": "markdown", |
232 | | - "id": "aging-istanbul", |
| 232 | + "id": "considered-battlefield", |
233 | 233 | "metadata": {}, |
234 | 234 | "source": [ |
235 | 235 | "## Reassign the NpzFile arrays to `x` and `y`\n", |
|
242 | 242 | { |
243 | 243 | "cell_type": "code", |
244 | 244 | "execution_count": 8, |
245 | | - "id": "patient-cooperation", |
| 245 | + "id": "experienced-granny", |
246 | 246 | "metadata": {}, |
247 | 247 | "outputs": [ |
248 | 248 | { |
|
263 | 263 | }, |
264 | 264 | { |
265 | 265 | "cell_type": "markdown", |
266 | | - "id": "super-pursuit", |
| 266 | + "id": "outstanding-jones", |
267 | 267 | "metadata": {}, |
268 | 268 | "source": [ |
269 | 269 | "## Success\n", |
|
294 | 294 | { |
295 | 295 | "cell_type": "code", |
296 | 296 | "execution_count": 9, |
297 | | - "id": "solved-cisco", |
| 297 | + "id": "portuguese-panel", |
298 | 298 | "metadata": {}, |
299 | 299 | "outputs": [ |
300 | 300 | { |
|
323 | 323 | }, |
324 | 324 | { |
325 | 325 | "cell_type": "markdown", |
326 | | - "id": "intelligent-minneapolis", |
| 326 | + "id": "meaning-blues", |
327 | 327 | "metadata": {}, |
328 | 328 | "source": [ |
329 | 329 | "## Save the data to csv file using [`savetxt`](https://numpy.org/doc/stable/reference/generated/numpy.savetxt.html#numpy.savetxt)\n", |
|
338 | 338 | { |
339 | 339 | "cell_type": "code", |
340 | 340 | "execution_count": 10, |
341 | | - "id": "photographic-flavor", |
| 341 | + "id": "still-entrepreneur", |
342 | 342 | "metadata": {}, |
343 | 343 | "outputs": [], |
344 | 344 | "source": [ |
|
347 | 347 | }, |
348 | 348 | { |
349 | 349 | "cell_type": "markdown", |
350 | | - "id": "intense-casino", |
| 350 | + "id": "entertaining-industry", |
351 | 351 | "metadata": {}, |
352 | 352 | "source": [ |
353 | 353 | "Open the file, `x_y-squared.csv`, and you'll see the following:\n", |
|
387 | 387 | { |
388 | 388 | "cell_type": "code", |
389 | 389 | "execution_count": 11, |
390 | | - "id": "amended-cincinnati", |
| 390 | + "id": "mathematical-destruction", |
391 | 391 | "metadata": {}, |
392 | 392 | "outputs": [], |
393 | 393 | "source": [ |
|
397 | 397 | { |
398 | 398 | "cell_type": "code", |
399 | 399 | "execution_count": 12, |
400 | | - "id": "thrown-credits", |
| 400 | + "id": "union-disorder", |
401 | 401 | "metadata": {}, |
402 | 402 | "outputs": [], |
403 | 403 | "source": [ |
|
409 | 409 | { |
410 | 410 | "cell_type": "code", |
411 | 411 | "execution_count": 13, |
412 | | - "id": "invalid-witness", |
| 412 | + "id": "fitted-clark", |
413 | 413 | "metadata": {}, |
414 | 414 | "outputs": [ |
415 | 415 | { |
|
430 | 430 | { |
431 | 431 | "cell_type": "code", |
432 | 432 | "execution_count": 14, |
433 | | - "id": "difficult-thunder", |
| 433 | + "id": "electronic-wedding", |
434 | 434 | "metadata": {}, |
435 | 435 | "outputs": [ |
436 | 436 | { |
|
451 | 451 | }, |
452 | 452 | { |
453 | 453 | "cell_type": "markdown", |
454 | | - "id": "dominican-progress", |
| 454 | + "id": "pleased-career", |
455 | 455 | "metadata": {}, |
456 | 456 | "source": [ |
457 | 457 | "## Success, but remember your types\n", |
|
462 | 462 | }, |
463 | 463 | { |
464 | 464 | "cell_type": "markdown", |
465 | | - "id": "affected-reward", |
| 465 | + "id": "ongoing-electron", |
466 | 466 | "metadata": {}, |
467 | 467 | "source": [ |
468 | 468 | "## Wrapping up\n", |
|
0 commit comments