diff --git a/processing/post/postResults.py b/processing/post/postResults.py index dc6cff592..db9801c48 100755 --- a/processing/post/postResults.py +++ b/processing/post/postResults.py @@ -479,13 +479,13 @@ def mapIncremental(label, mapping, N, base, new): # to a list of data # ----------------------------- - theMap = { 'min': lambda n,b,a: min(b,a), - 'max': lambda n,b,a: max(b,a), + theMap = { 'min': lambda n,b,a: a if n==0 else min(b,a), + 'max': lambda n,b,a: a if n==0 else max(b,a), 'avg': lambda n,b,a: (n*b+a)/(n+1), 'avgabs': lambda n,b,a: (n*b+abs(a))/(n+1), - 'sum': lambda n,b,a: b+a, - 'sumabs': lambda n,b,a: b+abs(a), - 'unique': lambda n,b,a: {True:a,False:'n/a'}[n==0 or b==a] + 'sum': lambda n,b,a: a if n==0 else b+a, + 'sumabs': lambda n,b,a: abs(a) if n==0 else b+abs(a), + 'unique': lambda n,b,a: a if n==0 or b==a else 'n/a' } if mapping in theMap: mapped = map(theMap[mapping],[N]*len(base),base,new) # map one of the standard functions to data