I was just wondering if there was an especially pythonic way of adding two tuples elementwise?
So far (a and b are tuples), I have
map(sum, zip(a, b))
My expected output would be:
(a[0] + b[0], a[1] + b[1], ...)
And a possible weighing would be to give a 0.5 weight and b 0.5 weight, or so on. (I'm trying to take a weighted average).
Which works fine, but say I wanted to add a weighting, I'm not quite sure how I would do that.
Thanks