title: numpy.unique sort based on counts
body: <p>The <code>numpy.unique</code> function allows to return the counts of unique elements if <code>return_counts</code> is <code>True</code>. Now the returned tuple consists of two arrays one containing the unique elements and the 2nd one containing a count array, both are sorted by the unique elements. Now is there a way to have both sorted according to the counts array instead of the unique elements? I mean I know how to do it the hard way but is there some concise one-liner or lambda functionality for such cases?</p>
  
  <p>Current result:</p>
  
  <pre><code>my_chr_list = ["a","a","a", "b", "c", "b","d", "d"]
  unique_els, counts = np.unique(my_chr_list, return_counts=True)
  print(unique_els, counts)
  </code></pre>
  
  <p>Which returns something along the lines of this:</p>
  
  <pre><code>&gt;&gt;&gt; (array(['a', 'b', 'c', 'd'], 
       dtype='&lt;U1'), array([3, 2, 1, 2], dtype=int64))
  </code></pre>
  
  <p>However, what I would want to have:</p>
  
  <pre><code>&gt;&gt;&gt; (array(['a', 'b', 'd', 'c'], 
       dtype='&lt;U1'), array([3, 2, 2, 1], dtype=int64))
  </code></pre>