title: Loop Pandas DF to append new lines to txt
body: <p>I have flat file (txt), in which I have Date column and Value column.</p>
  
  <p>I am trying to append new lines to the txt in case my dataframe receives new lines, using a loop logic. I have this following code:
  LastDate I am saying here its equal to 0 for simplicity reasons.</p>
  
  <pre><code>LastDate = 0
  saveFileLine = name+'.txt.'
  saveFile = open(saveFileLine,'a')
  
  for index, row in namedf.iterrows():
      if int(''.join(row['Date'].split('-')[:3])) &gt; LastDate:
          lineToWrite = row+'\n'
          saveFile.write(lineToWrite)
  
  saveFile.close()
  </code></pre>
  
  <p>and it gives me the error:</p>
  
  <p><strong>write() argument must be str, not Series</strong></p>
  
  <p>I dont know how to make it write the line of the loop currently active.</p>
  
  <p>Hope you can help me out!
  Thanks</p>