summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-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.