Skip to content

Instantly share code, notes, and snippets.

@Ari-Roda
Created December 9, 2017 01:19
Show Gist options
  • Save Ari-Roda/53c100449605e370ef66f1c06f15b62e to your computer and use it in GitHub Desktop.
Save Ari-Roda/53c100449605e370ef66f1c06f15b62e to your computer and use it in GitHub Desktop.
dict value to integer
dict = {'24': [2543.0, 212.0, 3.0, 810.0, 941.0, 137.0, 22.0, 66.0, 25834.0, 465.0, 115.0, 1248.0, 1865.0, 1923.0, 6218.0, 3708.0, 100.0, 530.0, 996.0, 2094.0, 2474.0, 15.0, 1866.0], '25': [107.0, 226.0, 192.0, 1383.0, 144.0, 679.0, 36236.0, 91.0, 199.0, 101.0, 8853.0, 284.0, 115.0, 1.0, 1.0], '26': [1706.0, 49920.0, 6082.0, 3738.0, 848.0, 61.0, 1110.0, 721.0, 292.0, 403.0, 1916.0, 61.0, 268.0, 6630.0, 1354.0, 396.0], '27': [1820.0, 86.0, 163.0, 359.0, 698.0], '20': [529.0, 151.0, 390.0, 2190.0, 166.0, 1779.0, 1441.0, 36884.0, 474.0, 831.0, 681.0, 3972.0, 28.0, 328.0, 6109.0, 80.0], '21': [537.0, 40335.0, 2122.0, 10.0, 23129.0, 190.0], '04': [2585.0, 2716.0], '23': [1236.0, 52.0, 256.0, 2293.0, 826.0, 254.0, 651.0, 1071.0, 8467.0], '29': [2176.0, 514.0, 3577.0, 32.0], '01': [1807.0, 1192.0], '14': [642.0, 1263.0, 2964.0, 7616.0, 41402.0, 15884.0, 6135.0], '11': [557.0, 196.0, 642.0, 1588.0, 292.0, 44.0, 134.0, 90.0, 542.0, 521.0, 91.0, 3.0, 562.0, 699.0, 1450.0, 1800.0, 2498.0, 3181.0, 3087.0, 3864.0, 518.0, 39.0, 510.0, 2059.0, 856.0, 550.0, 228.0], '10': [15271.0, 18.0, 2472.0, 11595.0], '13': [124.0, 450.0, 11.0, 285.0, 78.0, 1020.0, 4751.0, 35189.0, 772.0, 211.0, 119.0, 5629.0, 7150.0, 31.0, 15.0, 16.0, 3690.0, 7849.0], '12': [1597.0, 12.0, 101.0, 33.0, 42798.0, 12.0, 143.0, 352.0, 411.0, 27.0, 24.0, 832.0, 86.0, 1689.0, 10795.0, 1346.0, 7026.0], '15': [1234.0, 272.0, 555.0, 7.0, 205.0, 330.0, 31988.0, 5099.0, 6440.0, 19651.0], '22': [6.0, 36164.0, 720.0, 481.0, 50.0, 446.0, 1812.0, 612.0, 686.0, 284.0, 376.0, 2912.0], '17': [1781.0, 3.0, 76717.0], '16': [211.0, 138.0, 2924.0, 882.0, 980.0, 516.0, 7.0, 55.0, 405.0, 207.0, 34.0, 3814.0, 2408.0], '19': [323.0, 1795.0, 6.0, 79.0, 47622.0, 124.0, 309.0, 68.0, 145.0, 141.0, 595.0, 315.0], '18': [147.0, 34.0, 38863.0, 13124.0, 2648.0], '05': [3217.0, 48508.0]}
for i in dict.values():
i = sum(i)
#i[:] = [sum(i) / 3600] # puts answer into dict but as a list
print dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment