[Numpy-discussion] Initial implementation of histogram_discrete()

josef.pktd@gmai... josef.pktd@gmai...
Thu Nov 12 17:09:06 CST 2009


On Thu, Nov 12, 2009 at 6:00 PM, Priit Laes <plaes@plaes.org> wrote:
> Hey,
>
> I cooked up an initial implementation for one-dimensional
> histogram_discrete().
>
> Example:
>
>>> import numpy
>>> numpy.histogram_discrete([-1, 9, 9, 0, 3, 5, 3])
> array([1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 2])
>>> numpy.histogram_discrete([-99999, 99999])
> array([1, 0, 0, ..., 0, 0, 1])
>
> Suggestions, criticism? :)


Is there a difference to numpy.bincount ?

Josef




>
> Priit :)
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>


More information about the NumPy-Discussion mailing list