title: Python sort array and it's label array
body: <p>I need to sort boxes array from top left to bottom right, and I am using the solution here <a href="https://stackoverflow.com/questions/38654302/how-can-i-sort-contours-from-left-to-right-and-top-to-bottom">How can I sort contours from left to right and top to bottom?</a>. Which works fine. But I have another array which keep the box label,  I need to use this label after sorting tmp_box array. So how can sort <code>box_label</code> or keep the original index of <code>tmp_box</code> like this <a href="https://stackoverflow.com/questions/60969987/how-can-i-save-the-original-index-after-sorting-a-list">How can I save the original index after sorting a list?</a> which I can use to access the <code>box_label</code>.</p>
  <pre><code>box_label = [&quot;box1&quot;,&quot;box2&quot;,&quot;box3&quot;]
  tmp_box = []
  tmp_box.append([100,90,20,30]) #x,y,w,h
  tmp_box.append([90,80,25,30]) #x,y,w,h
  tmp_box.append([190,180,25,30]) #x,y,w,h
  
  tmp_box_np = np.array(tmp_box)
  max_height = np.max(tmp_box_np[::, 3])
  nearest = max_height * 1.4
  tmp_box.sort(key=lambda r: [int(nearest * round(float(r[1]) / nearest)), r[0]])
  </code></pre>