I have a list of lists and I need to summarize internal lists, e.g.
a = [[1,2,3], [2,1,4], [4,3,6]]
for my case, len of [i] is the same, that is, all internal lists have the same dimension.
and I need a conclusion like
result = [6,7,13]
What I've done:
result = [sum(a[i]) for i in range(len(a))]
Since my len (a) is very high, I hope there is an alternative way to get the result without using a for loop.
source share