[Numpy-discussion] sort method raises unexpected error with axis=None

Anne Archibald peridot.faceted@gmail....
Tue Feb 12 20:00:56 CST 2008


On 12/02/2008, Anne Archibald <peridot.faceted@gmail.com> wrote:
> An efficient way to handle in-place (or out-of-place, come to think of
> it) median along multiple axes is actually to take medians along all
> axes in succession. That saves you some sorting effort, and some
> programming effort, and doesn't require in-place multidimensional
> sorting:

Aargh. Sorry. No, that doesn't work:

In [28]: all_axes_median(N.reshape([1,5,6,7],(2,2)))
Out[28]: 4.75

Oops.

Anne


More information about the Numpy-discussion mailing list