diff options
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): |