diff options
author | Stephan Hoyer <shoyer@gmail.com> | 2016-01-15 13:25:43 -0800 |
---|---|---|
committer | Stephan Hoyer <shoyer@gmail.com> | 2016-01-15 13:25:43 -0800 |
commit | 54224f4e88036a8cd02c1306f2c1a5f655e41e3a (patch) | |
tree | b331b28110ddef0f897fa9b7c36ccd5433ac071a /numpy/core/fromnumeric.py | |
parent | 4d87d909bab7a7dd4bb570444cf35d98d551668f (diff) | |
parent | 02bcbd7e99f7b73c2abcb2726f79ea01a6bba2da (diff) | |
download | numpy-54224f4e88036a8cd02c1306f2c1a5f655e41e3a.tar.gz |
Merge pull request #7000 from gfyoung/ndarray_arg_enforce
DOC, MAINT: Enforce np.ndarray arg for np.put and np.place
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 5d74bbda0..4faeb557a 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -445,7 +445,13 @@ def put(a, ind, v, mode='raise'): array([ 0, 1, 2, 3, -5]) """ - return a.put(ind, v, mode) + try: + put = a.put + except AttributeError: + raise TypeError("argument 1 must be numpy.ndarray, " + "not {name}".format(name=type(a).__name__)) + + return put(ind, v, mode) def swapaxes(a, axis1, axis2): |