10 print 'usage: python %s infile outfile' % sys.argv[0]
16 binToCDF(infilename, outfilename)
19 def binToCDF(infilename, outfilename):
20 infile = open(infilename)
21 outfile = open(outfilename, 'w')
24 fields = line.strip().split()
28 total = int(fields[2])
33 outfile.write('%s\t%s\t%s\t%s' % (fields[0], fields[1], fields[2], fields[3]))
35 for bin in fields[4:]:
37 percent = 100 * cum / total
38 outfile.write('\t%d' % percent)
45 if __name__ == "__main__":