title: Python Pandas: Convert ".value_counts" output to dataframe
body: <p>Hi I want to get the counts of unique values of the dataframe. count_values implements this however I want to use its output somewhere else. How can I convert .count_values output to a pandas dataframe. here is an example code:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({'a':[1, 1, 2, 2, 2]})
  value_counts = df['a'].value_counts(dropna=True, sort=True)
  print(value_counts)
  print(type(value_counts))
  </code></pre>
  
  <p>output is:</p>
  
  <pre><code>2    3
  1    2
  Name: a, dtype: int64
  &lt;class 'pandas.core.series.Series'&gt;
  </code></pre>
  
  <p>What I need is a dataframe like this:</p>
  
  <pre><code>unique_values  counts
  2              3
  1              2
  </code></pre>
  
  <p>Thank you. </p>