- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
# TODO: fix this hell
def pretty_print(w, p):
w = truncate(w)
p = truncate(p)
my_matrix = zip(p, w)
print "\n".join(["\t\t".join(["\t".join(map(str, r)) for r in t]) for t in my_matrix])
# TODO: and this
def truncate(m):
for i in range(len(m)):
for j in range(len(m[0])):
if(len(str(m[i][j])) > 5):
m[i][j] = "%.3f" % m[i][j]
return m
Nemoden 23.04.2012 05:22 # +4
catcall 23.04.2012 05:27 # 0
Copy-Paste 04.06.2012 13:44 # +1