title: Append new column by subtracting existing column in csv by using python
body: <p>I tried to append new column to an existing csv file using python. it is not showing any error but the column is not created.</p>
  
  <p>I have a CSV  file with 5 columns and I want to add data in the 6th column by subtracting between existing columns.</p>
  
  <p>ID,SURFACES,A1X,A1Y,A1Z,A2X </p>
  
  <p>1,GROUND,800085.3323,961271.977,-3.07E-18,800080.8795</p>
  
  <p>ADD THE COLUMN AX( = A1X - A2X)</p>
  
  <p>CODE:</p>
  
  <pre><code>&gt;&gt;&gt; x = csv.reader(open('E:/solarpotential analysis/iitborientation/trialcsv.csv','rb'))
  &gt;&gt;&gt; y = csv.writer(open('E:/solarpotential analysis/iitborientation/trial.csv','wb',buffering=0))
  
  &gt;&gt;&gt; for row in x:
          a = float(row[0])
          b = str(row[1])
          c = float(row[2])
          d = float(row[3])
          e = float(row[4])
          f = float(row[2] - row[5])
      y.writerow([a,b,c,d,e,f])
  </code></pre>
  
  <p>it shows no error but not be updated in output file</p>