fork download
  1. import pandas as pd
  2.  
  3. array = []
  4. for i in range(0,10000):
  5. array.append(sum(list(map(int,str(i)))))
  6.  
  7. #sr=pd.Series(array)
  8. srv =pd.Series(array).value_counts().sort_index()
  9.  
  10. print(srv)
  11.  
Success #stdin #stdout 0.43s 61456KB
stdin
import pandas as pd

array = []
for i in range(0,10000):
    array.append(sum(list(map(int,str(i)))))

#sr=pd.Series(array)
srv =pd.Series(array).value_counts().sort_index()

print(srv)
stdout
0       1
1       4
2      10
3      20
4      35
5      56
6      84
7     120
8     165
9     220
10    282
11    348
12    415
13    480
14    540
15    592
16    633
17    660
18    670
19    660
20    633
21    592
22    540
23    480
24    415
25    348
26    282
27    220
28    165
29    120
30     84
31     56
32     35
33     20
34     10
35      4
36      1
dtype: int64