I have defined a dictionary as
coocurences = {('a', 'b'): 74, ('a', 'c'): 33, ('b', 'c'): 26}
and I would like to change the values of this dictionary into proportions of the sum of its values:
{('a', 'b'): 0,556390977443609, ('a', 'c'): 0,2481203007518797, ('b', 'c'): 0,1954887218045113}
I have tried with:
for x in coocurences.values():
x = (x/sum(coocurences.values()))
but it tells me: TypeError: 'builtin_function_or_method' object is not iterable. Any suggestions how to accomplish this?