[Numpy-discussion] histogram function return type
josef.pktd at gmail.com
josef.pktd at gmail.com
Sun Feb 6 09:44:50 EST 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