I know that if I have a dictionary filled with with x = {unique : count}
then I can use prop_dict = dict((k, round(v/sum(x.values()),2)) for k,v in x.items())
, but I do not know how to get there from an array/list.
Here is some sample data:
arr = [0., 137., 3., 1., 1., 5., 2., 2., 8., 31., 155.,
3., 233., 72., 302., 66., 416., 1., 148., 200., 237., 238.,
354., 383., 422., 192., 48., 78., 136., 15., 111., 5., 21.]