title: Python Pandas: Get dataframe.value_counts() result as list
body: <p>I have a <code>DataFrame</code> and I want to get both group names and corresponding group counts as a list or numpy array. However when I convert the output to matrix I only get group counts I dont get the names. Like in the example below: </p>
  
  <pre><code>  df = pd.DataFrame({'a':[0.5, 0.4, 5 , 0.4, 0.5, 0.6 ]})
    b = df['a'].value_counts()
    print(b)
  </code></pre>
  
  <p>output: </p>
  
  <pre><code>[0.4    2
  0.5    2
  0.6    1
  5.0    1
  Name: a, dtype: int64]
  </code></pre>
  
  <p>what I tried is <code>print[b.as_matrix()]</code>. Output: </p>
  
  <pre><code>[array([2, 2, 1, 1])]
  </code></pre>
  
  <p>In this case I do not have the information of corresponding group names which also I need. Thank you. </p>