Tweak Ex 31 in the notebook too
This commit is contained in:
@@ -477,8 +477,8 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"Z = np.dot(np.ones((5,3)), np.ones((3,2)))\n",
|
||||
"print(Z)",
|
||||
"\n\n",
|
||||
"print(Z)\n",
|
||||
"\n",
|
||||
"# Alternative solution, in Python 3.5 and above\n",
|
||||
"Z = np.ones((5,3)) @ np.ones((3,2))"
|
||||
]
|
||||
@@ -631,7 +631,13 @@
|
||||
"Z = np.ones(1) / 0\n",
|
||||
"\n",
|
||||
"# Back to sanity\n",
|
||||
"_ = np.seterr(**defaults)"
|
||||
"_ = np.seterr(**defaults)\n",
|
||||
"\n",
|
||||
"An equivalent way, with a context manager:\n",
|
||||
"\n",
|
||||
"```python\n",
|
||||
"with np.errstate(divide='ignore'):\n",
|
||||
" Z = np.ones(1) / 0"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -2334,7 +2340,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2"
|
||||
"version": "3.5.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user