[Numpy-discussion] Bug in numpy.histogram?
Mon Jun 9 10:38:07 CDT 2008
I understand this and agree, but it still means that the API for
broken since normed can only be used with the new=True parameter. I
the whole point of the future warning was to avoid this. It is not a
just means that one is forced to use the new API somewhat quicker :)
On Jun 9, 2008, at 11:17 AM, Pauli Virtanen wrote:
> ma, 2008-06-09 kello 11:11 -0400, Tommy Grav kirjoitti:
>> With the most recent change in numpy 1.1 it seems that
>> was broken when wanting a normalized histogram. I thought the idea
>> to leave the functionality of histogram as it was in 1.1 and then
>> break the api in 1.2?
>> data, bins = numpy.histogram(a,b,normed=True)
>> Traceback (most recent call last):
>> File "<console>", line 0, in <module>
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>> python2.5/site-packages/numpy/lib/function_base.py", line 189, in
>> raise ValueError, 'Use new=True to pass bin edges explicitly.'
>> ValueError: Use new=True to pass bin edges explicitly.
> I think the point in this specific change was that numpy.histogram
> previously returned invalid results when normed=True and explicit bins
> were given; the previous code always normalized the results assuming
> bins were of equal size.
> Moreover, I think it was not obvious what "normalized" results should
> mean when one of the bins is of infinite size.
> Numpy-discussion mailing list
More information about the Numpy-discussion