[SciPy-dev] Statistical review month : weighted histogram and cumfreq

David Huard david.huard at gmail.com
Tue Apr 11 20:26:23 EDT 2006


I recently had to compute a weighted cumulative frequency distribution so I
modified the scipy.stats.histogram and scipy.stats.cumfreq fonctions. I
added a key in both function call, namely weight=None, where the default is
simply uniform weights. I wanted to ask if this change would be welcome
before submitting the patch. My concern is that the change modifies the
result returned by the function. Presently, the histogram and cumfreq
functions return integers arrays, the number of items lying in certain
intervals. When these items are weighted, an integer count doesn't make much
sense, and I normalized the histogram and cumfreq results. In other words,
the new histogram function returns a float array of the frequency, instead
of a count. I feel that having a normalized output is more pratical, but it
would ruin existing code. There is always the possibility of creating a
whistogram and wcumfreq functions, but this is not a pretty solution.

I'd like your feedback about that.

Cheers,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20060411/a731692d/attachment.html>


More information about the SciPy-Dev mailing list