Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion histogrammar/primitives/sparselybin.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,12 @@ def _numpy(self, data, weights, shape):
subweights[selection] = 0.0
self.nanflow._numpy(data, subweights, shape)

q = q.copy()
# switch to float here like in bin.py else numpy throws
# TypeError on trivial integer cases such as:
# >>> q = numpy.array([1,2,3,4])
# >>> np.divide(q,1,q)
# >>> np.floor(q,q)
q = numpy.array(q, dtype=numpy.float64)
neginfs = numpy.isneginf(q)
posinfs = numpy.isposinf(q)

Expand Down