So then, "Tim Peters" <tim@zope.com> is all like:
The attached sets up an experiment:
create a vector of 50 "probabilities" at random, uniformly distributed in (0.0, 1.0)
combine them using Paul Graham's scheme, and using Gary Robinson's scheme
record the results
repeat 5000 times
The results should look familiar for those playing this game from the start:
Heh, I got an exception: Traceback (most recent call last): File "combine.py", line 56, in ? h1.display() File "Histogram.py", line 116, in display raise ValueError("nbuckets %g > 0 required" % nbuckets) TypeError: float argument required I patched Histogram.py to do what I think you meant (Also ITYM "buckets", not "buckts"): @@ -111,6 +112,8 @@ # buckts to a list of nbuckets counts, but only if at least one # data point is in the collection. def display(self, nbuckets=None, WIDTH=61): + if nbuckets is None: + nbuckets = self.nbuckets if nbuckets <= 0: raise ValueError("nbuckets %g > 0 required" % nbuckets) self.compute_stats() Submitted for your approval, Neale