[Numpy-discussion] Ticket #605 Incorrect behavior of numpy.histogram
Mon Apr 7 08:55:39 CDT 2008
+1 for an outlier keyword. Note, that this implies that when bins are passed
explicitly, the edges are given (nbins+1), not simply the left edges
While we are refactoring histogram, I'd suggest adding an axis keyword. This
is pretty straightforward to implement using the np.apply_along_axis
Also, I noticed that current normalization is buggy for non-uniform bin
db = bins - bins
return 1.0/(a.size*db) * n, bins
Finally, whatever option is chosen in the end, we should make sure it is
consistent across all histogram functions. This may mean that we will also
break the behavior of histogramdd and histogram2d.
Bruce: I did some work over the weekend on the histogram function, including
tests. If you want, I'll send that to you in the evening.
2008/4/7, Hans Meine <firstname.lastname@example.org>:
> Am Samstag, 05. April 2008 21:54:27 schrieb Anne Archibald:
> > There's also a fourth option - raise an exception if any points are
> > outside the range.
> I think this should be the default. Otherwise, I tend towards "exclude",
> order to have comparable bin sizes (when plotting, I always find peaks at
> ends annoying); this could also be called "clip" BTW.
> But really, an exception would follow the Zen: "In the face of ambiguity,
> refuse the temptation to guess." And with a kwarg: "Explicit is better
> histogram(a, arange(10), outliers = "clip")
> histogram(a, arange(10), outliers = "include")
> # better names? "include"->"accumulate"/"map to border"/"map"/"boundary"
> Ciao, / /
> / / ANS
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion