[Numpy-discussion] Median / mean functionality confusing?

Matthew Brett matthew.brett at gmail.com
Thu May 24 10:56:03 EDT 2007


Hi,

Does anyone else find this unexpected?

In [93]: import numpy as N
In [94]: a = N.arange(10).reshape(5,2)
In [95]: N.mean(a)
Out[95]: 4.5
In [96]: N.median(a)
Out[96]: array([4, 5])

i.e. shouldn't median have the same axis, dtype, default axis=None
behavior as mean?

Best,

Matthew



More information about the NumPy-Discussion mailing list