By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

NumPy argsort question

P: n/a
Hello,

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
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.