I have a list of numbers which I have rounded and now all numbers are divisible by 5.
napajecky=Round[{0.227`, 0.155`, 0.184`, 0.178`, 0.248`, 0.106`, 0.295`, 0.286`, 0.126`, 0.109`, 0.172`, 0.364`, 0.131`, 0.268`, 0.3`, 0.172`,
0.324`, 0.359`, 0.52`, 0.277`, 0.169`, 0.303`, 0.169`, 0.097`,
0.265`, 0.063`, 0.262`, 0.19`, 0.095`, 0.059`, 0.035`, 0.051`,
0.163`, 0.099`, 0.038`, 0.093`, 0.16`, 0.1454`, 0.3803`, 0.2437`,
0.0359`, 0.0959`, 0.0346`, 0.136`, 0.275`, 0.003`, 0.004`, 0.003`,
0.003`, 0.005`, 0.1686`, 0.1031`}*100, 5]
Now, I need to make a new list which would count number of occurences of numbers divisible by 5 in the rounded list and link it with that particular number. So the new list would look like this e.g.: newlist={number of occurence of number 5 is 7, number of occurences of number 10 is 8,number of occurences of number 15 is 12, ... etc.}
I tried to define function that would count these occurences in certain range (5 to 80) but it does´t work:
f[x_]:=Count[x,Range[5,80,5]
res=f/@napajecky
Can you help me to find the best way? Thank you for advice.
BinCounts
andCounts
would be useful here. $\endgroup$Tally
which is included in theSee Also
section of the documentation forCount
$\endgroup$