Closed
Description
The following simple example no longer works:
np.histogram([ 0., 0., 0., 1., 2., 3., 3., 4., 5.], bins=30, range=(-0.5, 5))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-7ea9ff24a0b8> in <module>()
----> 1 np.histogram([ 0., 0., 0., 1., 2., 3., 3., 4., 5.], bins=30, range=(-0.5, 5))
/Users/tom/miniconda3/envs/dev35/lib/python3.5/site-packages/numpy/lib/function_base.py in histogram(a, bins, range, normed, weights, density)
683 n.imag += np.bincount(indices, weights=tmp_w.imag, minlength=bins)
684 else:
--> 685 n += np.bincount(indices, weights=tmp_w, minlength=bins).astype(ntype)
686
687 # Rename the bin edges for return.
ValueError: operands could not be broadcast together with shapes (30,) (31,) (30,)
I think this is a result of #7667, and is a bug due to the 5 not being correctly identified as an end point.
Metadata
Metadata
Assignees
Labels
No labels