title: Counter object to JSON string in Python
body: <p>I am new in Python and would appreciate your help.
  I got this counter object :</p>
  
  <pre><code>Counter({1: 10, 2: 10, 3: 10, 4: 10, 5: 10, 6: 10, 7: 10, 8: 10, 9: 10, 10: 
          10})
  </code></pre>
  
  <p>Each key is actually a userId with a count <code>number_of_posts</code> as a value.</p>
  
  <p>So what I finally need is to convert this counter object to a JSON like so :</p>
  
  <pre><code>{ 
      “user”:
          {
              id: int
              number_of_posts: int
          }
  }
  </code></pre>
  
  <p>Please advise..
  Thanks
  Raffi </p>