summaryrefslogtreecommitdiff
path: root/numpy/doc/misc.py
diff options
context:
space:
mode:
authorPaul Ivanov <paul.ivanov@local>2009-12-28 20:49:52 +0000
committerPaul Ivanov <paul.ivanov@local>2009-12-28 20:49:52 +0000
commite4f233ecfedd2aafa258db2d3ae27e30604cc020 (patch)
tree6d32fbdd19b8dca00cd7cafd8df076bac55ddfd8 /numpy/doc/misc.py
parent5ba01996a9ab2fdfb7c120a5afae801f854a781a (diff)
downloadnumpy-e4f233ecfedd2aafa258db2d3ae27e30604cc020.tar.gz
fixed a whole bunch of doctests
Diffstat (limited to 'numpy/doc/misc.py')
-rw-r--r--numpy/doc/misc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/doc/misc.py b/numpy/doc/misc.py
index eb2dc4395..8575a8e4f 100644
--- a/numpy/doc/misc.py
+++ b/numpy/doc/misc.py
@@ -13,12 +13,12 @@ original value was)
Note: cannot use equality to test NaNs. E.g.: ::
+ >>> myarr = np.array([1., 0., np.nan, 3.])
>>> np.where(myarr == np.nan)
>>> nan == nan # is always False! Use special numpy functions instead.
>>> np.nan == np.nan
False
- >>> myarr = np.array([1., 0., np.nan, 3.])
>>> myarr[myarr == np.nan] = 0. # doesn't work
>>> myarr
array([ 1., 0., NaN, 3.])
@@ -68,7 +68,7 @@ These behaviors can be set for all kinds of errors or specific ones: ::
underflow: floating point underflows
Note that integer divide-by-zero is handled by the same machinery.
-These behaviors are set on a per-thead basis.
+These behaviors are set on a per-thread basis.
Examples:
------------
@@ -86,6 +86,7 @@ Examples:
>>> def errorhandler(errstr, errflag):
... print "saw stupid error!"
>>> np.seterrcall(errorhandler)
+<function err_handler at 0x...>
>>> j = np.seterr(all='call')
>>> np.zeros(5, dtype=np.int32)/0
FloatingPointError: invalid value encountered in divide