title: Clear or delete 2nd column in csv with python
body: <p>I have the following code (attempt) at clearing the 2nd column of data in my csv:</p>
  
  <pre><code>    def del_col(in_path):
      # read file into memory
          file_obj = open(in_path, 'rb')
          reader = csv.reader(file_obj, delimiter='\t')
  
  
  # delete the status column here:
  
  
  
  # Now write csv back to same file: 
  
          # write data to file
          file_obj = open(in_path, 'rb')
          writer = csv.writer(file_obj)
          writer.writerows(data)
          file_obj.close()
  </code></pre>
  
  <p>I'm not sure if or how to clear this column. Should I read down the data row-wise and clear the 2nd entry per each row? Or is there a more simplistic way to simply clear the 2nd column at once? </p>
  
  <p>Here is a 2nd attempt:</p>
  
  <pre><code>def del_col(in_path):
      # read file into memory
      file_obj = open(in_path, 'rb')
      reader = csv.reader(file_obj, delimiter='\t')
      data = []
      for row in reader:
  
      # delete the status column here:
  
          vals = [x[:1] + x[2:] for x in reader]
          print vals
          file_obj.close()
  
      print 'Delete the 2nd Column (Lead Status?)'
      conf = raw_input('delete these leads? (Y|N): ').upper()[0]
  
      if conf == 'Y':
          # write data to file
          file_obj = open(in_path, 'wb')
          writer = csv.writer(file_obj)
          writer.writerows(data)
          file_obj.close()
  </code></pre>