title: Changing order of one array with respect to another in Python
body: <p>I have two arrays <code>A</code> and <code>B</code> with one-to-one correspondence i.e. values corresponding to <code>[0,1] in A</code> is <code>10 in B</code>, <code>[0,2] in A</code> is <code>20 in B</code> and so on. Now I sort <code>A</code> to yield a new array <code>A1</code>. How do I generate <code>B1</code> with respect to <code>A1</code>? The desired output is attached.</p>
  <pre><code>import numpy as np
  A = np.array([[[0, 1],[0, 2],[1, 3],[2, 3],[2, 5],[3, 4],[3, 6],[4, 7],[5, 6],[6, 7]]])
  B = np.array([[[10],[20],[30],[40],[50],[60],[70],[80],[90],[100]]])
  A1=np.sort(A,axis=1)
  #A1=array([[[0, 1],[0, 2],[1, 3],[2, 3],[3,4],[2, 5],[3, 6],[5, 6],[4, 7],[6, 7]]])
  </code></pre>
  <p>The desired output is</p>
  <pre><code>B1=array([[[10],[20],[30],[40],[60],[50],[70],[90],[80],[100]]])
  </code></pre>