Skip to content

Commit 77b1fc0

Browse files
authored
Merge pull request #21 from mbaak/1.0.x
Good point.
2 parents 675a297 + f066209 commit 77b1fc0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

histogrammar/primitives/sparselybin.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,12 @@ def _numpy(self, data, weights, shape):
363363
subweights[selection] = 0.0
364364
self.nanflow._numpy(data, subweights, shape)
365365

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

0 commit comments

Comments
 (0)