#!/usr/bin/env python3 import collections import csv import glob import statistics # type-values-aggregation-model[-epochs] results = {} for filename in glob.glob('extend_*'): with open(filename) as fp: reader = csv.reader(fp, delimiter=' ') for row in reader: assert row[0] == 'RESULT' if row[1] not in results: results[row[1]] = [ [], [], [] ] for i in range(3): results[row[1]][i].append(float(row[2+i])) def key_fix(x): return int(x[0]) results = collections.OrderedDict(sorted(results.items(), key=key_fix)) for i in results: print(i, end='') for j in range(len(results[i])): print('', statistics.mean(results[i][j]), statistics.stdev(results[i][j]), end='') print()