title: DataFrame interrows() and .to_csv: Writing row by row
body: <p>I'm using following script to</p>
  
  <ul>
  <li>Apply a function to a column in each row of a DataFrame</li>
  <li>Write the returns from that function into two new columns of a DataFrame</li>
  <li>Continuously write the DataFrame into a *.csv</li>
  </ul>
  
  <p>I like to learn whether there's a <em>better way</em> to run the following computation:</p>
  
  <p>df = a DataFrame with 500 rows, 20 columns</p>
  
  <pre><code>for index, row in df.iterrows():
      df.loc[index, 'words'], df.loc[index, 'count'] = transcribe(df.loc[index, 'text'])
      df.to_csv('out.csv', encoding='utf-8', index=False)
  </code></pre>
  
  <p>Currently, the script each time (for each row) outputs the full df dataframe as *.csv, including the added values for the computed rows "words" and "counts" until then. I like to know, whether it would also be possible to just write line by line complete, i.e. to only output those lines in the csv that are complete.</p>
  
  <p>Thanks!</p>