summaryrefslogtreecommitdiff
path: root/numpy/core/multiarray.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2019-01-01 21:57:07 -0800
committerStephan Hoyer <shoyer@google.com>2019-01-01 21:57:07 -0800
commit70f97a5040e20642b68e45d30e030a89ac89e665 (patch)
tree3f6ae620ff857478acfa91b1b8d4f8655d8cf373 /numpy/core/multiarray.py
parent43298265ab35b82e29ff772c466872a78531fabd (diff)
downloadnumpy-70f97a5040e20642b68e45d30e030a89ac89e665.tar.gz
TST: check exception details in refguide_check.py
xref GH-12548
Diffstat (limited to 'numpy/core/multiarray.py')
-rw-r--r--numpy/core/multiarray.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/multiarray.py b/numpy/core/multiarray.py
index 4c2715892..3cc882055 100644
--- a/numpy/core/multiarray.py
+++ b/numpy/core/multiarray.py
@@ -893,8 +893,9 @@ def bincount(x, weights=None, minlength=None):
>>> np.bincount(np.arange(5, dtype=float))
Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: array cannot be safely cast to required type
+ ...
+ TypeError: Cannot cast array data from dtype('float64') to dtype('int64')
+ according to the rule 'safe'
A possible use of ``bincount`` is to perform sums over
variable-size chunks of an array, using the ``weights`` keyword.