https://github.com/kpalin/EEL
Tip revision: c0cd936bedca30564088c8aeb8f43ebe4e05421f authored by Kimmo Palin on 07 November 2012, 13:23:26 UTC
Fixed a variable format clash which sometimes caused core dumps.
Fixed a variable format clash which sometimes caused core dumps.
Tip revision: c0cd936
affinity2freq.py
import sys
a=sys.stdin.readlines()
b=map(lambda x:map(int,x.split()),a)
tot=[0.0]*len(b[0])
for c in b:
tot=map(lambda x,y:x+y,c,tot)
suurin=max(tot)
suurin=reduce(lambda x,y:x+y,tot)
c=map(lambda x:map(lambda y,t:round(suurin*y/t),x,tot),b)
d=map(lambda y:"".join(map(lambda x:"%5.0f"%x,y))+"\n",c)
for i in d:
print i,