[Numpy-discussion] Argsort

Ryan May rmay31@gmail....
Thu Feb 5 17:06:49 CST 2009


Hi,

Ok, what am I missing here:

x = np.array([[4,2],[5,3]])
x[x.argsort(1)]

array([[[5, 3],
        [4, 2]],

       [[5, 3],
        [4, 2]]])

I was expecting:

array([[2,4],[3,5]])

Certainly not a 3D array.  What am I doing wrong?

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma


More information about the Numpy-discussion mailing list