[numarray] mean vector of 2d matrix

Curzio Basso curzio.basso at unibas.ch
Mon May 10 11:25:17 EDT 2004


Hi all,

I was wondering what is the best way to compute the mean vector of a 
matrix. Currently I'm doing this:

 >>> data.shape
(117027, 8)
 >>> mean = (numarray.add.reduce(data, axis=1))/(data.shape[1])

but maybe there is a faster way?

cheers



More information about the Python-list mailing list