title: How does one sort dictionary values?
body: <p>Is there a way to sort (and return) a dictionary by multiple values? The below returns the values in a list. I'd like to improve on the below and also return the keys so that the returned data structure is a sorted dictionary.</p>
  <pre><code>df = pd.DataFrame([[-1,1,-1,3,1,2]], index = 
                       pd.date_range(start = '2022-02-07', periods =1, name = 'Date'))
  
  df.columns = pd.MultiIndex.from_tuples(((&quot;IINN&quot;, &quot;s&quot;), (&quot;IINN&quot;, &quot;count&quot;), 
                       (&quot;GII&quot;, &quot;s&quot;), (&quot;GII&quot;,&quot;count&quot;),(&quot;HCM&quot;,&quot;s&quot;), (&quot;HCM&quot;, &quot;count&quot;)))
  
  
  dct={c:df[c] for c in df.columns.levels[0]}
  
  sorted(dct.values(),key = lambda item: (item['s'][-1],item['count'][-1]), reverse=True)
  
  
  [            s  count
   Date
   2022-02-07  1      2,
               s  count
   Date
   2022-02-07 -1      3,
               s  count
   Date
   2022-02-07 -1      1]
  </code></pre>