What is the neatest way to multiply element-wise a list of lists of numbers?
E.g.
[[1,2,3],[2,3,4],[3,4,5]] -> [6,24,60]
import operator import functools answer = [functools.reduce(operator.mul, subl) for subl in L]
Or, if you prefer map:
answer = map(functools.partial(functools.reduce, operator.mul), L) # listify as required