I have a dictionary in the form:
{"a": (1, 0.1), "b": (2, 0.2), ...}
Each tuple corresponds to (score, standard deviation). How can I take the average of just the first integer in each tuple? I've tried this:
for word in d:
(score, std) = d[word]
d[word]=float(score),float(std)
if word in string:
number = len(string)
v = sum(score)
return (v) / number
Get this error:
v = sum(score)
TypeError: 'int' object is not iterable