histogram2d error with empty inputs
I found another empty input edge case. Somewhat recently, we fixed an issue with np.histogram() and empty inputs (so long as the bins are somehow known).
np.histogram([], bins=4) (array([0, 0, 0, 0]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]))
However, histogram2d needs the same treatment.
np.histogram([], [], bins=4) (array([ 0., 0.]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]))
The first element in the return tuple needs to be 4x4 (in this case). Thanks, Ben Root
On Mon, Jun 27, 2011 at 9:38 PM, Benjamin Root <ben.root@ou.edu> wrote:
I found another empty input edge case. Somewhat recently, we fixed an issue with np.histogram() and empty inputs (so long as the bins are somehow known).
np.histogram([], bins=4) (array([0, 0, 0, 0]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]))
However, histogram2d needs the same treatment.
np.histogram([], [], bins=4) (array([ 0., 0.]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]))
The first element in the return tuple needs to be 4x4 (in this case).
Could you open a ticket for this?
Ralf
On Wednesday, July 6, 2011, Ralf Gommers <ralf.gommers@googlemail.com> wrote:
On Mon, Jun 27, 2011 at 9:38 PM, Benjamin Root <ben.root@ou.edu> wrote:
I found another empty input edge case. Somewhat recently, we fixed an issue with np.histogram() and empty inputs (so long as the bins are somehow known).
np.histogram([], bins=4) (array([0, 0, 0, 0]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]))
However, histogram2d needs the same treatment.
np.histogram([], [], bins=4) (array([ 0., 0.]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]), array([ 0. , 0.25, 0.5 , 0.75, 1. ]))
The first element in the return tuple needs to be 4x4 (in this case).
Could you open a ticket for this?
Ralf
Not a problem. I managed to partly trace the problem down into histogramdd, but the function is a little confusing. Ben Root
participants (2)
-
Benjamin Root
-
Ralf Gommers