title: Save columns as csv pandas
body: <p>I'm trying to save specific columns to a csv using pandas. However, there is only one line on the output file. Is there anything wrong with my code? My desired output is to save all columns where d.count() == 1 to a csv file.</p>
  
  <pre><code>import pandas as pd
  
  results = pd.read_csv('employee.csv', sep=';', delimiter=';', low_memory=False)
  results['index'] = results.groupby('Name').cumcount()
  d = results.pivot(index='index', columns='Name', values='Job')
  for columns in d:
      if (d[columns]).count() &gt; 1:
          (d[columns]).dropna(how='any').to_csv('output.csv')
  </code></pre>