title: Writing to a specific cell in csv using python
body: <p>I have a set of sentences in a text file and I have the verbs from it marked as column headers in csv file. I need to mark a '1' in the specific cell under the right column, if the verb is present in that sentence. 
  e.g.</p>
  
  <p>If my sentence is: I like this movie.</p>
  
  <p>My csv file has the headers: like, hate and loathe.</p>
  
  <p>Then I need my csv file to look like</p>
  
  <pre><code>  like       hate       loathe
     1
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>Here's the code I have tried:</p>
  
  <pre><code>with open('verb.csv', 'wb') as csvn:
      cwriter = csv.writer(csvn)
      cwriter.writerow([d for d in verbs])
  </code></pre>
  
  <p>where verbs is my list of verbs. This prints the verbs as column headers in csv file. </p>
  
  <pre><code>for l, label in file:
      t = nltk.word_tokenize(l)
      tt = nltk.pos_tag(t)
      for pos in tt:
          for p in pos[1]:
              c = 0
              if(p == 'V'):
                  w = pos[0]
                  for l in verbs:
                      if w == l:
                          print(c)
                          continue
                      else:
                          c+=1
  </code></pre>
  
  <p>Now w contains the verb and I can search for a matching word in the list of verbs and obtain its location, but I don't have a clue how I could mark the corresponding location in the csv file as 1. My python version is 2.7.</p>