I have two nested lists:
a = [[1,2,3],[2,4,2]]
b = [[5,5,5],[1,1,1]]
I want to multiply and SUMPRODUCT each group of elements to get
c = [[30],[8]]
Which result from = [[1*5+2*5+3*5],[2*1,4*1,2*1]]
I´ve tried doing:
c = sum(x * y for x, y in zip(a, b))
But I get "can't multiply sequence by non-int of type 'list'"
Is there a simple list comprehension way to do this avoiding for loops?