Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > NumPy argsort question

Thread Tools

NumPy argsort question

Ivan Lima
Posts: n/a

I have two 2-dimensional arrays A and B. I want to sort A along its
columns (axis=1) and then sort B along its columns in the same order
that A was sorted.

I tried:

sorted_A = sort(A,1)
sorted_B = take(B, argsort(A,1), 1)

but my last statement returns an array with an extra dimension. If A
is a 2x3 matrix I get a 2x2x3 matrix. What am I missing?

Thanks a lot,

Ivan Lima - idl764 at yahoo dot com
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing numpy over an older numpy Tom Kacvinsky Python 1 06-15-2012 07:15 PM
A More Concise Description of Numpy than the Guide to Numpy? W. eWatson Python 2 11-23-2009 08:58 PM
NumPy Question - numpy.put in multi-dimensional array Python 2 11-13-2007 10:36 PM
numpy migration (also posted to numpy-discussion) Duncan Smith Python 3 04-25-2007 01:36 AM
Trouble with numpy-0.9.4 and numpy-0.9.5 drife Python 1 03-01-2006 05:59 PM