Changeset 10942:425926238265 in orange for Orange/data/utils.py


Ignore:
Timestamp:
06/28/12 00:16:09 (22 months ago)
Author:
Peter Husen <phusen@…>
Branch:
default
Message:

Changes to group by:

  • Enable auto-commit, but don't disable commit button, as changed settings are not handled
  • Count any type of attribute
  • Fixes for max and min of empty list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/data/utils.py

    r10700 r10942  
    233233                      "geometric mean": geometric_mean, 
    234234                      "harmonic mean": harmonic_mean, 
    235                       "min": lambda values: min([float(v) for v in values if not v.is_special()]), 
    236                       "max": lambda values: max([float(v) for v in values if not v.is_special()]), 
     235                      "min": lambda values : min( [(0,v) for v in values if not v.is_special()] + [(1,"?")] )[1], 
     236                      "max": lambda values : max( [(1,v) for v in values if not v.is_special()] + [(0,"?")] )[1], 
    237237                      "sum": lambda values: sum([float(v) for v in values if not v.is_special()]), 
    238238                      "count": len, 
Note: See TracChangeset for help on using the changeset viewer.