You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When called with weights, and with weights being a numpy array, bh.numpy.histogram() fails. The error is:
~/repos/pandana/work-venv/lib/python3.9/site-packages/boost_histogram/numpy.py in histogram(a, bins, range, normed, weights, density, **kwargs)
108
109 # numpy 1d histogram returns integers in some cases
--> 110 if "storage" not in kwargs and not (weights or normed or density):
111 kwargs["storage"] = _storage.Int64()
112
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I believe the testing of weights, normed and density should be comparing to None:
--> 110 if "storage" not in kwargs and weights is None and normed is None and density is None):
111 kwargs["storage"] = _storage.Int64()
112
The text was updated successfully, but these errors were encountered:
Ahh, this is in numpy.py. I was quite sure I had tests for this for the regular histograms. Okay, yes, quite likely a mistake! Needs a test or two as well. Thanks!
When called with
weights
, and withweights
being anumpy
array,bh.numpy.histogram()
fails. The error is:I believe the testing of
weights
,normed
anddensity
should be comparing toNone
:The text was updated successfully, but these errors were encountered: