Re: [Numpy-discussion] histogram2d and histogramdd return counts as floats while histogram returns ints

2012-05-14 Thread Nils Becker
 is this intended?
 
 np.histogramdd([[1,2],[3,4]],bins=2)
 
 (array([[ 1.,  0.],
[ 0.,  1.]]),
  [array([ 1. ,  1.5,  2. ]), array([ 3. ,  3.5,  4. ])])
 
 np.histogram2d([1,2],[3,4],bins=2)
 
 (array([[ 1.,  0.],
[ 0.,  1.]]),
  array([ 1. ,  1.5,  2. ]),
  array([ 3. ,  3.5,  4. ]))
 
 np.histogram([1,2],bins=2)
 
 (array([1, 1]), array([ 1. ,  1.5,  2. ]))

maybe i should have been more explicit. what i meant to say is that

1. the counts in a histogram are integers. whenever no normalization is
used i would expect that i get an integer array when i call a histogram
function.
2. now it might be intended that the data type is always the same so
that float has to be used to accomodate the normalized histograms.
3. in any case, the 1d histogram function handles this differently from
the 2d and dd ones. this seems inconsistent and might be considered a bug.

n.

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] histogram2d and histogramdd return counts as floats while histogram returns ints

2012-05-11 Thread Nils Becker
hi,

is this intended?

np.histogramdd([[1,2],[3,4]],bins=2)

(array([[ 1.,  0.],
   [ 0.,  1.]]),
 [array([ 1. ,  1.5,  2. ]), array([ 3. ,  3.5,  4. ])])

np.histogram2d([1,2],[3,4],bins=2)

(array([[ 1.,  0.],
   [ 0.,  1.]]),
 array([ 1. ,  1.5,  2. ]),
 array([ 3. ,  3.5,  4. ]))

np.histogram([1,2],bins=2)

(array([1, 1]), array([ 1. ,  1.5,  2. ]))


n.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion