python - Converting a list into a dictionary -


This is my list and I want to convert it to a dictionary for key value 1- 9. I am using Benford's law and I am trying to find the starting points of each number and I keep in mind that the number of times each number is the starting number. Here is my list, it goes on a lot of time, but I have just copied a small amount.

  [ '2930', '4782', 70 '9', '433', '29861', '20115', '15114', '2417', '737', '966 ',' 8863 ',' 355 ',' 23561 ',' 8272 ',' 1288 ',' 1 9 61 ',' 746 ',' 318 ',' 2100 ''18 9 0', '2643', ' 24194 "," 1010 9 ',' 6587 ',' 57828 ',' 877 ',' 488 ',' 624 ',' 722 ',' 322 ',' 222 ',' 8342 ',' 3163 ', .. Import counter from collection <= code> 
  ['2930' , '4782', 70 '9', '433', '29861', '20115', '15114', '2417', '737', '966', '8863', '355', '23561' '8272', '1288', '1 9 61', '746', '318', '2100', '1890', '2643', '24194', '1010 9', '6587', '57828' , '877', '488', '624', '722', '322', '222', '8342', '3163'] C = Counter (for L in [x]] gt; & Gt; & Gt; C counter ('2': 9, '1': 5, '3': 4, '7': 4, '8': 4, 4 ': 3,' 6 ': 2,' 5 ' 1, '9': 1})  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -