1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import division
liste1=[[459, '24'], [369, '25'], [839, '26'], [451, '27'], [191, '20'], [207, '21'], [392, '22'], [621, '23'], [212, '28'], [126, '29'], [46, '0'], [36, '4'], [287, '8'], [198, '59'], [152, '58'], [136, '55'], [58, '54'], [147, '57'], [154, '56'], [103, '51'], [63, '50'], [64, '53'], [40, '52'], [131, '115'], [77, '114'], [111, '117']]
liste2=[[274, '24'], [168, '25'], [547, '26'], [296, '27'], [187, '20'], [70, '21'], [214, '22'], [378, '23'], [306, '28'], [363, '29'], [93, '0'], [86, '4'], [85, '8'], [67, '59'], [77, '58'], [81, '55'], [53, '54'], [103, '57'], [129, '56'], [84, '51'], [45, '50'], [79, '53'], [70, '52'], [78, '115'], [34, '114']]
liste3=[[63, '24'], [28, '25'], [108, '26'], [92, '27'], [63, '20'], [21, '21'], [40, '22'], [78, '23'], [109, '28'], [265, '29'], [65, '0'], [69, '4'], [35, '8'], [23, '59'], [35, '58'], [43, '55'], [36, '54'], [63, '57'], [72, '56'], [43, '51'], [38, '50'], [57, '53'], [64, '52'], [50, '115'], [26, '114']]
dico={'24': 796, '25': 565, '26': 1494, '27': 839, '20': 441, '21': 298, '22': 646, '23': 1077, '28': 627, '29': 754, '0': 204, '4': 191, '8': 407, '59': 288, '58': 264, '55': 260, '54': 147, '57': 313, '56': 355, '51': 230, '50': 146, '53': 200, '52': 174, '115': 259, '114': 137}
ratios1 = []
for cle in dico.keys():
for i,j in liste1:
if j==cle:
ratios1.append([cle,i/dico[cle]])
break
ratios2 = []
for cle in dico.keys():
for i,j in liste2:
if j==cle:
ratios2.append([cle,i/dico[cle]])
break
ratios3 = []
for cle in dico.keys():
for i,j in liste3:
if j==cle:
ratios3.append([cle,i/dico[cle]])
break |
Partager