Changeset 10912:457ebf8cfa1b in orange


Ignore:
Timestamp:
06/14/12 11:49:34 (23 months ago)
Author:
mstajdohar
Branch:
default
rebase_source:
dfa09b58ae238ff1c0665b34ea73170e888ce66a
Message:

Fixed numpy nonzero related bug in _getsum_i.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/data/preprocess/scaling.py

    r10705 r10912  
    851851        else: 
    852852            sum_i = numpy.add.reduce(data) 
    853         if len(numpy.nonzero(sum_i)) < len(sum_i):    # test if there are zeros in sum_i 
     853        if len(sum_i[numpy.nonzero(sum_i)]) < len(sum_i):    # test if there are zeros in sum_i 
    854854            sum_i += numpy.where(sum_i == 0, 1.0, 0.0) 
    855855        return sum_i 
Note: See TracChangeset for help on using the changeset viewer.