aboutsummaryrefslogtreecommitdiff
path: root/doc/conv.py
blob: 4689d9bc09e4e4ae24d3a0d2b425d69f123b0f71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from sys import stdout
f = open("res.csv", "r")
matrix = list()
for line in f.readlines():
    matrix.append([float(x) for x in line.split()[1:]])
col = len(matrix[0])
row = len(matrix)
inf = 1e9
for j in xrange(col):
    best = inf
    for i in xrange(row):
        if matrix[i][j] < best:
            best = matrix[i][j]
    for i in xrange(row):
        if matrix[i][j] > inf:
            r = '-'
        else:
            r = str(matrix[i][j] / best)
        stdout.write('{0} '.format(r))
    stdout.write('\n')