mention np.errstate context manager in exercise 31.

This commit is contained in:
Evgeni Burovski 2016-10-29 17:03:53 +03:00 committed by GitHub
parent e8ad2e1123
commit 4cb1d8cd76

View File

@ -288,6 +288,13 @@ Z = np.ones(1)/0
_ = np.seterr(**defaults) _ = np.seterr(**defaults)
``` ```
An equivalent way, with a context manager:
```python
with np.errstate(divide='ignore'):
Z = np.ones(1) / 0
```
#### 32. Is the following expressions true? (★☆☆) #### 32. Is the following expressions true? (★☆☆)