title: How to convert Counter object to dict?
body: <p>Data frame:</p>
  
  <pre><code>pair = collections.defaultdict(collections.Counter)
  </code></pre>
  
  <p>e.g.</p>
  
  <pre><code>pair = {'doc1':  {'word1':4, 'word2':3}, 
          'doc2':  {'word1':2, 'word3':4},
          'doc3':  {'word2':2, 'word4':1},
           ...}
  </code></pre>
  
  <p>I want to keep the data frame but alter the type of this part <code>{'word1':4, 'word2':3}</code> <code>{'word1':2, 'word3':4}``...</code> It is now a <code>Counter</code> and I need a <code>dict</code>.</p>
  
  <p>I tried this to get the data from <code>pair</code>, but I do not know how to create a <code>dict</code> for each doc:</p>
  
  <pre><code>new_pair = collections.defaultdict(collections.Counter)
  for doc, tab in testing.form.items():
      for word, freq in tab.items():
          new_pair[doc][word] = freq 
  </code></pre>
  
  <p>I do not want to change the output. I just need that <strong>in each doc, the data type is <code>dict</code>, not <code>Counter</code>.</strong></p>