correcting syntax errors in ipy notebook

This commit is contained in:
ibah
2016-09-01 13:52:41 +02:00
parent 9b248dd3de
commit 1a20be883b
2 changed files with 7 additions and 5 deletions

View File

@@ -855,12 +855,13 @@
"source": [ "source": [
"A = np.random.randint(0,2,5)\n", "A = np.random.randint(0,2,5)\n",
"B = np.random.randint(0,2,5)\n", "B = np.random.randint(0,2,5)\n",
"# Assuming identical shape of the arrays and a tolerance for the comparison of values" "\n",
"# Assuming identical shape of the arrays and a tolerance for the comparison of values\n",
"equal = np.allclose(A,B)\n", "equal = np.allclose(A,B)\n",
"print(equal)" "print(equal)\n",
"\n" "\n",
"# Checking both the shape and the element values, no tolerance (values have to be exactly equal)" "# Checking both the shape and the element values, no tolerance (values have to be exactly equal)\n",
"equal = np.array_equal(A,B)" "equal = np.array_equal(A,B)\n",
"print(equal)" "print(equal)"
] ]
}, },

View File

@@ -387,6 +387,7 @@ np.add.reduce(Z)
```python ```python
A = np.random.randint(0,2,5) A = np.random.randint(0,2,5)
B = np.random.randint(0,2,5) B = np.random.randint(0,2,5)
# Assuming identical shape of the arrays and a tolerance for the comparison of values # Assuming identical shape of the arrays and a tolerance for the comparison of values
equal = np.allclose(A,B) equal = np.allclose(A,B)
print(equal) print(equal)