[Numpy-discussion] numpy release
Thu Apr 24 13:22:41 CDT 2008
The problem I see with C is that it will break compatibility with the other
histogram functions, which also use bins.
So here is suggestion E:
The most common use case ( I think) is the following:
h, b = histogram(r, number_of_bins, normed=True/False) for which the
function behaves correctly.
Assuming we want the next version to : ignore values outside of range and
accept and return the bin edges instead of the left edges, here could be the
new signature for 1.1:
h, edges = histogram(a, bins=10, normed=False, range=None, normed=False,
If new=False, return the histogram and the left edges, with a warning that
in the next version, the edges will be returned. If new=True, return the
histogram and the edges.
If range is given explicitly , raise a warning saying that in the next
version, the outliers will be ignored. To ignore outliers, use new=True.
If bins is a sequence, raise an error saying that bins should be an integer.
To use explicit edges, use new=True.
In 1.2, set new=True as the default, and in 2.3, remove new altogether.
2008/4/24 Travis E. Oliphant <email@example.com>:
> Pauli Virtanen wrote:
> > C) Create a new parameter with more sensible behavior and a name
> > different from "bins", and deprecate (at least giving sequences to) the
> > "bins" parameter: put up a DeprecationWarning if the user does this, but
> > still produce the same results as the old histogram. This way the user
> > can forward-port her code at leisure.
> > D) Or, retain the old behavior (values below lowest bin ignored) and
> > just fix the docstring and the normed=True bug? (I have a patch doing
> > this.)
> > So which one (or something else) do we choose for 1.1.0?
> I like either C or D, but prefer C if it can be done before 1.1.0.
> Numpy-discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion