0
How can I sum column elements in matrix[3][2]
Like 1 6 8 5 9 7 Sum =1+8+9
4 Réponses
+ 4
Without using any additional module, this does calculate all row sums:
a=[[1,6,2],
[8,5,4],
[9,7,-3]]
x = 0
while x < len(a[0]):
print(sum([i[x] for i in a]))
x += 1
0
Learn pandas you will know all about it