Hi,

I simply can't understand this. I'm trying to use argsort to produce indices that can be used to sort an array:

  from numpy import *

  indices = array([[4,3],[1,12],[23,7],[11,6],[8,9]])
  args = argsort(indices, axis=0)
  print indices[args]

gives:

[[[ 1 12]
  [ 4  3]]

 [[ 4  3]
  [11  6]]

 [[ 8  9]
  [23  7]]

 [[11  6]
  [ 8  9]]

 [[23  7]
  [ 1 12]]]

I thought this should produce a sorted version of the indices array.

Any help is appreciated.

Best regards,

Mads

--
+-----------------------------------------------------+
| Mads Ipsen                                          |
+----------------------+------------------------------+
| Gåsebæksvej 7, 4. tv |                              |
| DK-2500 Valby        | phone:          +45-29716388 |
| Denmark              | email:  mads.ip...@gmail.com |
+----------------------+------------------------------+

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to