[Numpy-discussion] histogram function return type

josef.pktd@gmai... josef.pktd@gmai...
Sun Feb 6 08:44:50 CST 2011


there is some inconsistency in the return type of the histogram
function, 1d returns int, others return float

>>> np.histogramdd([y, x], bins=3)[0]
array([[  3.,  15.,   3.],
       [ 10.,   2.,   9.],
       [  4.,   0.,   5.]])
>>> np.histogram2d(y, x, bins=3)[0]
array([[  3.,  15.,   3.],
       [ 10.,   2.,   9.],
       [  4.,   0.,   5.]])

>>> np.histogram(y, bins=3)[0]
array([21, 21,  9])

Josef


More information about the NumPy-Discussion mailing list