It seems scipy once provided a function mad to calculate the mean absolute deviation for a set of numbers:
mad
http://projects.scipy.org/scipy/browser/trunk
Using numpy only:
numpy
def meanDeviation(numpyArray): mean = np.mean(numpyArray) f = lambda x: abs(x - mean) vf = np.vectorize(f) return (np.add.reduce(vf(numpyArray))) / len(numpyArray)