Skip to content

Commit 5293a4f

Browse files
authored
Merge pull request #142 from silx-kit/review_henri
Review henri
2 parents 5ce4e26 + c59c588 commit 5293a4f

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

python/numpy/introduction_to_numpy.ipynb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,10 +1434,10 @@
14341434
},
14351435
"outputs": [],
14361436
"source": [
1437-
"print(\"a:\", a)\n",
1438-
"print(\"b:\", b)\n",
1439-
"print(\"c:\", c)\n",
1440-
"print(\"d:\", d)"
1437+
"print(\"a:\", a, sep=\"\\n\")\n",
1438+
"print(\"b:\", b, sep=\"\\n\")\n",
1439+
"print(\"c:\", c, sep=\"\\n\")\n",
1440+
"print(\"d:\", d, sep=\"\\n\")"
14411441
]
14421442
},
14431443
{
@@ -1449,7 +1449,7 @@
14491449
"tags": []
14501450
},
14511451
"source": [
1452-
"Be careful when using `numpy.copy` as it is shallow, and it will not copy object elements within arrays. For these corner cases, you need to use `copy.deepcopy`."
1452+
"Be careful when using `numpy.copy` as it is shallow, and it will not copy object elements within arrays. For these corner cases, you need to use `copy.deepcopy`. See the [python copy module](https://docs.python.org/3/library/copy.html)"
14531453
]
14541454
},
14551455
{
@@ -1491,7 +1491,7 @@
14911491
"tags": []
14921492
},
14931493
"source": [
1494-
"The ``dtype`` attribute identifies the type of the elements of the array."
1494+
"The [``dtype``](https://numpy.org/doc/stable/reference/arrays.dtypes.html) attribute identifies the type of the elements of the array."
14951495
]
14961496
},
14971497
{
@@ -1594,13 +1594,13 @@
15941594
"source": [
15951595
"### More array attributes\n",
15961596
"\n",
1597-
"* ``ndim``: Number of dimensions\n",
1598-
"* ``size``: Total number of elements\n",
1599-
"* ``itemsize``: Size of a single item (in bytes))\n",
1600-
"* ``strides``: Bytes to step in each dimension\n",
1601-
"* ``flags``: Contiguity of the data in the buffer\n",
1602-
"* ``nbytes``: Size in bytes occupied in memory\n",
1603-
"* ``data``: Read/write buffer containing the data"
1597+
"* [``ndim``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ndim.html): Number of dimensions\n",
1598+
"* [``size``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.size.html): Total number of elements\n",
1599+
"* [``itemsize``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.itemsize.html): Size of a single item (in bytes))\n",
1600+
"* [``strides``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.strides.html): Bytes to step in each dimension\n",
1601+
"* [``flags``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flags.html): Contiguity of the data in the buffer\n",
1602+
"* [``nbytes``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.nbytes.html): Size in bytes occupied in memory\n",
1603+
"* [``data``](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.data.html): Read/write buffer containing the data"
16041604
]
16051605
},
16061606
{
@@ -1953,7 +1953,7 @@
19531953
"source": [
19541954
"## Exercise \n",
19551955
"\n",
1956-
"Suppose we want to shrink the physical size of a 1000x1000 gray-value image by a factor 4, without changing the type of the pixels.\n",
1956+
"Suppose we want to shrink the physical size of a 100x100 gray-value image by a factor 4, without changing the type of the pixels.\n",
19571957
"A natural approach is to reduce the number of pixels by a factor 2 in each dimension. This operation is called **binning**. It consists in replacing each 2x2 square in the image by one single pixel value. The next question is: which value should be assigned to each pixel in the new image.\n",
19581958
"\n",
19591959
"\n",

0 commit comments

Comments
 (0)