title: Sort a numpy array of numpy arrays by lengths of the internal arrays
body: <p>If I have a numpy array with each element being another numpy array of varying lengths (not an ndarray because of this), how can I sort the outer array by descending lengths of the inner array?</p>
  
  <p>For example:</p>
  
  <pre><code>a = np.array([np.array([1]), np.array([1, 2, 3]), np.array([1, 2])])
  </code></pre>
  
  <p>would be sorted as:</p>
  
  <pre><code>[[1, 2, 3], [1, 2], [1]]
  </code></pre>