Changeset 9595:854156c89f05 in orange


Ignore:
Timestamp:
01/27/12 13:57:38 (2 years ago)
Author:
ales_erjavec
Branch:
default
Message:

Check for non negative product in geometric_mean

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/data/utils.py

    r9122 r9595  
    209209    if values: 
    210210        prod = reduce(float.__mul__, values, 1.0) 
    211         print prod, len(values) 
    212         return math.pow(prod, 1.0/len(values)) 
     211        if prod >= 0: 
     212            return math.pow(prod, 1.0/len(values)) 
     213        else: 
     214            return "?" 
    213215    else: 
    214216        return "?" 
Note: See TracChangeset for help on using the changeset viewer.