title: Grouping Python dictionary keys as a list and create a new dictionary with this list as a value
body: <p>I have a python dictionary</p>
  <pre><code>d = {1: 6, 2: 1, 3: 1, 4: 9, 5: 9, 6: 1}
  </code></pre>
  <p>Since the values in the above dictionary are not unique, I want to group the all the keys of unique values as a list and create a new dictionary as follows:</p>
  <pre><code>v = {6:[1], 1:[2, 3, 6], 9: [4, 5]}
  </code></pre>
  <p>Note the keys of new dictionary <strong>v</strong> should be sorted. I am finding it hard to visualize and implement this dictionary creation.</p>