Skip to content

Commit

Permalink
small doctest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Ivanov committed Dec 30, 2009
1 parent 79939bd commit 4717bd0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions numpy/doc/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
>>> 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
>>> np.nan == np.nan # is always False! Use special numpy functions instead.
False
>>> myarr[myarr == np.nan] = 0. # doesn't work
>>> myarr
Expand Down Expand Up @@ -86,13 +84,13 @@
>>> def errorhandler(errstr, errflag):
... print "saw stupid error!"
>>> np.seterrcall(errorhandler)
<function err_handler at 0x...>
<function err_handler at 0x...>
>>> j = np.seterr(all='call')
>>> np.zeros(5, dtype=np.int32)/0
FloatingPointError: invalid value encountered in divide
saw stupid error!
>>> j = np.seterr(**oldsettings) # restore previous
# error-handling settings
... # error-handling settings
Interfacing to C:
-----------------
Expand Down

0 comments on commit 4717bd0

Please sign in to comment.