Reduce methods give wrong output with shapes that contain 0

Bug #573240 reported by kwgoodman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
larry
Fix Committed
Low
kwgoodman

Bug Description

The reduce methods (sum, mean, max, lastrank, etc) do not return the correct output when the input is ndim > 1 with a shape that contains a zero.

For example, la.larry(np.zeros((2,0,3))).sum(1) returns NaN but should return:

>> la.larry(np.zeros((2,0,3))).sum(1)
label_0
    0
    1
label_1
    0
    1
    2
x
array([[ NaN, NaN, NaN],
       [ NaN, NaN, NaN]])

This bug is related to Bug #518442.

which would match numpy:

>> np.nansum(np.zeros((2,0,3)), 1)

array([[ NaN, NaN, NaN],
       [ NaN, NaN, NaN]])

Related branches

kwgoodman (kwgoodman)
Changed in larry:
milestone: none → 0.3
assignee: nobody → kwgoodman (kwgoodman)
importance: Undecided → Low
status: New → In Progress
kwgoodman (kwgoodman)
Changed in larry:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.