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

2009-08-27 Thread josef . pktd
On Thu, Aug 27, 2009 at 1:27 PM, wrote: > On Thu, Aug 27, 2009 at 12:49 PM, Tim > Michelsen wrote: >>> Tim, do you mean, that you want to apply other functions, e.g. mean or >>> variance, to the original values but calculated per bin? >> Sorry that I forgot to add this. Shame. >> >> I would like t

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

2009-08-27 Thread josef . pktd
On Thu, Aug 27, 2009 at 12:49 PM, Tim Michelsen wrote: >> Tim, do you mean, that you want to apply other functions, e.g. mean or >> variance, to the original values but calculated per bin? > Sorry that I forgot to add this. Shame. > > I would like to apply these mathematical functions on the origin

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

2009-08-27 Thread Tim Michelsen
> Tim, do you mean, that you want to apply other functions, e.g. mean or > variance, to the original values but calculated per bin? Sorry that I forgot to add this. Shame. I would like to apply these mathematical functions on the original values stacked in the respective bins. For instance: The

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

2009-08-27 Thread josef . pktd
On Thu, Aug 27, 2009 at 9:23 AM, Vincent Schut wrote: > Tim Michelsen wrote: >> 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) = nu

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

2009-08-27 Thread Vincent Schut
Tim Michelsen wrote: > 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

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

2009-08-27 Thread josef . pktd
On Thu, Aug 27, 2009 at 8:23 AM, alexander baker wrote: > Here is an example, this does something a extra at the end but shows how the > bins can be used. > > Regards > > Alex Baker. > > from scipy.stats import norm > r = norm.rvs(size=1) > > import numpy as np > p, bins = np.histogram(r, width

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

2009-08-27 Thread alexander baker
Here is an example, this does something a extra at the end but shows how the bins can be used. Regards Alex Baker. from scipy.stats import norm r = norm.rvs(size=1) import numpy as np p, bins = np.histogram(r, width, normed=True) db = bins[1]-bins[0] cdf = np.cumsum(p*db) from pylab import

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

2009-08-27 Thread Tim Michelsen
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 stac