title: Putting a dict into a dataframe - python
body: <p>I have a list called 'gender', of which I counted all the occurrences of the values with Counter:</p>
  
  <pre><code>gender = ['2',
            'Female,',
            'All Female Group,',
            'All Male Group,',
            'Female,',
            'Couple,',
            'Mixed Group,'....]
  
  gender_count = Counter(gender)
  gender_count 
  Counter({'2': 1,
       'All Female Group,': 222,
       'All Male Group,': 119,
       'Couple,': 256,
       'Female,': 1738,
       'Male,': 2077,
       'Mixed Group,': 212,
       'NA': 16})
  </code></pre>
  
  <p>I want to put this dict into a pandas Dataframe. I have used pd.series(<a href="https://stackoverflow.com/questions/18837262/convert-python-dict-into-a-dataframe">Convert Python dict into a dataframe</a>):</p>
  
  <pre><code>s = pd.Series(gender_count, name='gender count')
  s.index.name = 'gender'
  s.reset_index()
  </code></pre>
  
  <p>Which gives me the dataframe I want, but I don't know how to save these steps into a pandas DataFrame.
  I also tried using DataFrame.from_dict()</p>
  
  <pre><code>s2 = pd.DataFrame.from_dict(gender_count, orient='index')
  </code></pre>
  
  <p>But this creates a dataframe with the categories of gender as the index. </p>
  
  <p>I eventually want to use gender categories and the count for a piechart.</p>