- if l:
- vals.append(float(l))
-print '%s,%s,%s,%s' % (min(vals), m.mean(vals), max(vals), m.std(vals))
+ if not l:
+ continue
+ try:
+ fields = dict([('$'+str(int(k)+1), float(v.strip()))
+ for k, v in enumerate(l.split(sep))])
+ v = float(eval(re.sub(r'(\$\d+)', r'%(\1)f', exp) % fields))
+ except:
+ if n == 0:
+ continue
+ raise
+ vals.append(v)
+vars = dict(min=min(vals), mean=m.mean(vals), max=max(vals), std=m.std(vals))
+print fmt % vars