Suppose you have store the original cij in a numpy array, you might like to sum up terms like c11+c21+c31+c41 first. This can be done by summing up each column, try c.sum(axis = 0)
>>> import numpy as np
>>> c = np.arange(24).reshape(4,6)
>>> c
array([[ 0, 1, 2, 3, 4, 5],
[ 6, 7, 8, 9, 10, 11],
[12, 13, 14, 15, 16, 17],
[18, 19, 20, 21, 22, 23]])
>>> c = c.sum(axis=0)
>>> c
array([36, 40, 44, 48, 52, 56])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…