Changeset d7f24b2 for tools


Ignore:
Timestamp:
Jun 23, 2019, 3:59:46 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
fe065c3
Parents:
aca144e
Message:

use floating point for all calculations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/stat.py

    raca144e rd7f24b2  
    1111                content = f.readlines()
    1212                content = [x.strip() for x in content]
    13                 content = [int(x) for x in content]
    14                 content.remove(max(content))
    15                 content.remove(min(content))
    16                 med = numpy.around( numpy.median(content), decimals=1)
    17                 avg = numpy.around( numpy.mean  (content), decimals=2)
    18                 std = numpy.around( numpy.std   (content), decimals=2)
    19                 print "median {0} avg {1} stddev {2}".format( med, avg, std )
     13                content = [float(x) for x in content]   # expect floating-point strings
     14                content.remove(max(content))            # need at least 4 data values because
     15                content.remove(min(content))            # the max and min values are removed
     16                med = numpy.median(content)
     17                avg = numpy.mean  (content)
     18                std = numpy.std   (content)
     19                print "median {0:.1f} avg {1:.1f} stddev {2:.2f}".format( med, avg, std )
    2020
    2121
Note: See TracChangeset for help on using the changeset viewer.