[Numpy-discussion] histogram: sum up values in each bin

Tim Michelsen timmichelsen at gmx-topmail.de
Thu Aug 27 08:07:12 EDT 2009


Hello,
I need some advice on histograms.
If I interpret the documentation [1, 2] for numpy.histogram correctly, the
result of the function is a count of the occurences sorted into each bin.

(n, bins) = numpy.histogram(v, bins=50, normed=1)

But how can I apply another function on these values stacked in each bin?
Like summing them up or building averages?

Thanks,
Timmie

[1] http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html
[2]
http://www.scipy.org/Tentative_NumPy_Tutorial#head-aa75ec76530ff51a2e98071adb7224a4b793519e




More information about the NumPy-Discussion mailing list