Skip to content

Commit 04b3714

Browse files
authored
Merge pull request rougier#20 from ibah/master
Fixing issue rougier#19 (syntax errors in ipython notebook in commit 4fa32cb)
2 parents 9e6559e + 1a20be8 commit 04b3714

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

100 Numpy exercises.ipynb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,13 @@
855855
"source": [
856856
"A = np.random.randint(0,2,5)\n",
857857
"B = np.random.randint(0,2,5)\n",
858+
"\n",
859+
"# Assuming identical shape of the arrays and a tolerance for the comparison of values\n",
858860
"equal = np.allclose(A,B)\n",
861+
"print(equal)\n",
862+
"\n",
863+
"# Checking both the shape and the element values, no tolerance (values have to be exactly equal)\n",
864+
"equal = np.array_equal(A,B)\n",
859865
"print(equal)"
860866
]
861867
},

100 Numpy exercises.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,14 @@ np.add.reduce(Z)
387387
```python
388388
A = np.random.randint(0,2,5)
389389
B = np.random.randint(0,2,5)
390+
391+
# Assuming identical shape of the arrays and a tolerance for the comparison of values
390392
equal = np.allclose(A,B)
391393
print(equal)
394+
395+
# Checking both the shape and the element values, no tolerance (values have to be exactly equal)
396+
equal = np.array_equal(A,B)
397+
print(equal)
392398
```
393399

394400
#### 43. Make an array immutable (read-only) (★★☆)

0 commit comments

Comments
 (0)