sum across columns numpy code example
Example 1: sum along axis python
import numpy as np
matrix=np.ones((10,10))
print(matrix.sum(axis=0))
print(matrix.sum(axis=1))
Example 2: sum elements array with step numy
b = [sum(a[current: current+5]) for current in xrange(0, len(a), 5)]