Skip to content

Commit 1a20be8

Browse files
committed
correcting syntax errors in ipy notebook
1 parent 9b248dd commit 1a20be8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

100 Numpy exercises.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,13 +855,14 @@
855855
"source": [
856856
"A = np.random.randint(0,2,5)\n",
857857
"B = np.random.randint(0,2,5)\n",
858-
"# Assuming identical shape of the arrays and a tolerance for the comparison of values"
858+
"\n",
859+
"# Assuming identical shape of the arrays and a tolerance for the comparison of values\n",
859860
"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",
860865
"print(equal)"
861-
"\n"
862-
"# Checking both the shape and the element values, no tolerance (values have to be exactly equal)"
863-
"equal = np.array_equal(A,B)"
864-
"print(equal)"
865866
]
866867
},
867868
{

100 Numpy exercises.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ np.add.reduce(Z)
387387
```python
388388
A = np.random.randint(0,2,5)
389389
B = np.random.randint(0,2,5)
390+
390391
# Assuming identical shape of the arrays and a tolerance for the comparison of values
391392
equal = np.allclose(A,B)
392393
print(equal)

0 commit comments

Comments
 (0)