diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-07-31 00:41:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 00:41:28 -0700 |
commit | 7f4579279a6a6aa07df664b901afa36ab3fc5ce0 (patch) | |
tree | 3524c05c661f4948eabf066b46b5ad3aaf6ad617 /numpy/lib/utils.py | |
parent | 24960daf3e326591047eb099af840da6e95d0910 (diff) | |
parent | 9bb569c4e0e1cf08128179d157bdab10c8706a97 (diff) | |
download | numpy-7f4579279a6a6aa07df664b901afa36ab3fc5ce0.tar.gz |
Merge branch 'master' into ix_-preserve-type
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 61aa5e33b..9678bab76 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -339,7 +339,7 @@ def who(vardict=None): #----------------------------------------------------------------------------- -# NOTE: pydoc defines a help function which works simliarly to this +# NOTE: pydoc defines a help function which works similarly to this # except it uses a pager to take over the screen. # combine name and arguments and split to multiple lines of width @@ -557,7 +557,7 @@ def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'): if len(arglist) > 1: arglist[1] = "("+arglist[1] arguments = ", ".join(arglist[1:]) - except: + except Exception: pass if len(name+arguments) > maxwidth: @@ -689,7 +689,7 @@ def source(object, output=sys.stdout): try: print("In file: %s\n" % inspect.getsourcefile(object), file=output) print(inspect.getsource(object), file=output) - except: + except Exception: print("Not available for this object.", file=output) @@ -707,7 +707,7 @@ def lookfor(what, module=None, import_modules=True, regenerate=False, """ Do a keyword search on docstrings. - A list of of objects that matched the search is displayed, + A list of objects that matched the search is displayed, sorted by relevance. All given keywords need to be found in the docstring for it to be returned as a result, but the order does not matter. @@ -982,12 +982,12 @@ def _getmembers(item): #----------------------------------------------------------------------------- # The following SafeEval class and company are adapted from Michael Spencer's -# ASPN Python Cookbook recipe: -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/364469 +# ASPN Python Cookbook recipe: https://code.activestate.com/recipes/364469/ +# # Accordingly it is mostly Copyright 2006 by Michael Spencer. # The recipe, like most of the other ASPN Python Cookbook recipes was made # available under the Python license. -# http://www.python.org/license +# https://en.wikipedia.org/wiki/Python_License # It has been modified to: # * handle unary -/+ @@ -1138,7 +1138,7 @@ def _median_nancheck(data, result, axis, out): """ if data.size == 0: return result - data = np.rollaxis(data, axis, data.ndim) + data = np.moveaxis(data, axis, -1) n = np.isnan(data[..., -1]) # masked NaN values are ok if np.ma.isMaskedArray(n): |