You need to use Numpy function mean() with "axis=0" to compute average by column. To compute average by row, you need to use "axis=1".
>>> import numpy as np>>> a=np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]])>>> aarray([[ 1, 2, 3, 4], [ 5, 6, 7, 8], [ 9, 10, 11, 12], [13, 14, 15, 16]])>>> a.mean(axis=0) #average by columnarray([ 7., 8., 9., 10.])>>> a.mean(axis=1) #average by rowarray([ 2.5, 6.5, 10.5, 14.5])