title: How to avoid repeating header when Writing to CSV in loop?
body: <p>I want to save the values of different variables in a CSV file. But it prints another header every time. I don't want this, I am attaching my CSV file snapshot for your understanding. <a href="https://i.stack.imgur.com/IobIS.png" rel="nofollow noreferrer">Output csv</a></p>
  
  <pre><code>file_orimg = open('Org_image.csv', 'a', newline='')
  writer_orimg = csv.writer(file_orimg, delimiter='\t',lineterminator='\n',)
  writer_orimg.writerow(["Image Name", "epsilon","MSE", "SSIM", "Prediction", "Probability"])
  
  for i in images:
       writer_orimg.writerow([i, epsilon, mse, ssim, clean_pred, clean_prob, label_idx.item()])
  </code></pre>