exchanged string 'n/a' for 'nan' to allow smooth parsing as float value
This commit is contained in:
parent
4f5e96d366
commit
5b8bc65d37
|
@ -431,7 +431,7 @@ def mapIncremental(label, mapping, N, base, new):
|
||||||
'avgabs': lambda n,b,a: (n*b+abs(a))/(n+1),
|
'avgabs': lambda n,b,a: (n*b+abs(a))/(n+1),
|
||||||
'sum': lambda n,b,a: a if n==0 else 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),
|
'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'
|
'unique': lambda n,b,a: a if n==0 or b==a else 'nan'
|
||||||
}
|
}
|
||||||
if mapping in theMap:
|
if mapping in theMap:
|
||||||
mapped = map(theMap[mapping],[N]*len(base),base,new) # map one of the standard functions to data
|
mapped = map(theMap[mapping],[N]*len(base),base,new) # map one of the standard functions to data
|
||||||
|
@ -442,7 +442,7 @@ def mapIncremental(label, mapping, N, base, new):
|
||||||
try:
|
try:
|
||||||
mapped = eval('map(%s,[N]*len(base),base,new)'%mapping) # map user defined function to colums in chunks
|
mapped = eval('map(%s,[N]*len(base),base,new)'%mapping) # map user defined function to colums in chunks
|
||||||
except:
|
except:
|
||||||
mapped = ['n/a']*len(base)
|
mapped = ['nan']*len(base)
|
||||||
|
|
||||||
return mapped
|
return mapped
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue