[SciPy-user] mean of arrays...
Thu Sep 6 08:56:21 CDT 2007
Gael Varoquaux a écrit :
> On Thu, Sep 06, 2007 at 09:34:17AM -0400, Gary Pajer wrote:
>>> listmean = lambda l: concatenate([a[..., newaxis] for a in l],
>> Am I missing something here?
>> doesn't numpy.mean() find the mean of all elements regardless of dimension?
> That's what the "axis=-1" is for.
> Did I make an error ? This should be working, I tested it.
As my arrays are set in a list (data), here's my solution:
data_mean = array(data).transpose().mean(axis=-1).transpose()
Thanks to all.
More information about the SciPy-user