title: python pandas insert column
body: <p>I am writing code to insert a new column in a csv file:</p>
  
  <pre><code>import sys,os,csv,glob
  dir = os.path.dirname(__file__)
  
  import pandas as pd 
  
  updatecsv()
  
  def updatecsv():
  
      files = 'example.cs'
      df = pd.read_csv(files)
      df = df.convert_objects(convert_numeric=True)
      #until here, the code is running fine
      #now i wanted to add a new column in a specific index with all value =10           
      df.insert(2,'new',1000)
  </code></pre>
  
  <p>When I run the code, no error was given. When I open the csv file, the new row is not added. I decided to check using python shell:</p>
  
  <pre><code>&gt;&gt;&gt;files = 'example.csv'
  &gt;&gt;&gt;df = pd.read_csv(files)
  &gt;&gt;&gt;df = df.convert_objects(convert_numeric=True)
  &gt;&gt;&gt;df
     A   B   C   D
  0  1   2   3   4
  1  5   6   7   8
  2  9  10  11  12
  df['new']=13
  &gt;&gt;&gt;df
     A   B   C   D  new
  0  1   2   3   4   13
  1  5   6   7   8   13
  2  9  10  11  12   13
  &gt;&gt;&gt;df['new'] = df['new'] +1
  &gt;&gt;&gt;df
     A   B   C   D  new
  0  1   2   3   4   14
  1  5   6   7   8   14
  2  9  10  11  12   14
  &gt;&gt;&gt;df.insert(2,'win',22)
  &gt;&gt;&gt;df
     A   B  win   C   D  new
  0  1   2   22   3   4   14
  1  5   6   22   7   8   14
  2  9  10   22  11  12   14
  </code></pre>
  
  <p>Using the python shell, I can see the result updated on the shell only. How do I update it in the CSV file as well?</p>