Hi Wayne,

you are right all these function use the sample-data and not the pdf / 
frequency of occurence-histogram, because typically the data is available and 
not the pdf. Maybe the scipy mailing list could give you a solution to your 
problem.

In case that your freqency of occurence are integers you could do something 
like the following to generate the sample-data and than you the previous 
mentioned functions:
bin_centers = np.array([ 1.,  2.,  3.,  4.,  5.])
n_vals = np.array([1, 3, 0, 2, 1])
sample_new = np.array([])
for bin_center, n in zip(bin_centers, n_vals): 
    # append new value 'n' times: 
    sample_new = np.concatenate((sample_new, [bin_center]*n))

Kind regards,
Matthias

On Tuesday 01 December 2009 17:51:31 Wayne Watson wrote:
> I do not believe that any of those calculations are based on the pdf,
> frequency of occurrence-histogram. This, (1, 2,2, 4, 2,5,4) and not this
> (1,3, 0,2,1). The latter are the frequencies of occurrence for 1,2,3,4,5.
>
> John Hunter wrote:
> > On Tue, Dec 1, 2009 at 6:32 AM, Wayne Watson
> >
> > <sierra_mtnv...@sbcglobal.net> wrote:
> >> Is there some statistics function that computes the mean, std. dev.,
> >> min/max, etc. from a frequency distribution?
> >
> > numpy has many functions for basic descriptive statistics.  If "data"
> > is an array of your data, you can do (import numpy as np)
> >
> > mean: np.mean(data)
> > median: np.median(data)
> > standard deviation: np.std(data)
> > min: np.min(data)
> > max: np.max(data)
> >
> > In scipy.stats, there are many more (skew, kurtosis, etc...)  See
> > also, this example:
> >
> >
> > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/py4science/
> >examples/stats_descriptives.py?view=markup&pathrev=4027
> >
> > JDH



------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to