source: tools/stat.py @ 18e683b

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 18e683b was 0bdd8d2a, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Updated stat script to round after 2 decimals

  • Property mode set to 100755
File size: 599 bytes
RevLine 
[bfd15e8]1#!/usr/bin/python
2
3import sys
4import numpy
5
6if len(sys.argv) != 2 :
7        sys.exit("Expected file name as only argument")
8
9try:
10        with open(sys.argv[1]) as f:
11                content = f.readlines()
12                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))
[0bdd8d2a]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 )
[bfd15e8]20
21
22except IOError as e:
23        sys.exit(e.strerror)
Note: See TracBrowser for help on using the repository browser.