why not simply specify an axis to np.mean?