title: Write df.value_counts to new file
body: <p>I have a data frame of cluster labels generated using DBSCAN and I am counting the frequency of the cluster labels. I can print the frequency using <code>df['cluster_labels'].value_counts()</code>, but when I go to write this to a new file, I just get the count of clusters but not their corresponding label. How can I write this to write to a new file with the cluster label and the frequency? Below are screenshots and code. </p>
  
  <p><strong>When printing</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/2TFDC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2TFDC.jpg" alt="enter image description here"></a></p>
  
  <p><strong>When writing:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/uz01F.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uz01F.jpg" alt="enter image description here"></a></p>
  
  <pre><code>df['cluster_labels'] = cluster_labels
  cluster_counts = df['cluster_labels'].value_counts()
  print cluster_counts
  cluster_counts.to_csv('G:\Programming Projects\GGS 681\dmv_tweets_20170309_20170314_cluster_counts.csv', index=False, header=True)
  
  df_filtered = df[cluster_labels&gt;-1]
  cluster_outputs = pd.DataFrame(df_filtered)
  #cluster_outputs.to_csv('G:\Programming Projects\GGS 
  681\dmv_tweets_20170309_20170314_cluster_outputs.csv', index=False, header=True)
  </code></pre>
  
  <p><strong>Error passing new headers to file</strong></p>
  
  <p><a href="https://i.stack.imgur.com/gt399.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gt399.jpg" alt="enter image description here"></a></p>