Here is the code I was using to manipulate a CSV file. It is not entering the 2nd and 3rd for loops.
import csv
f=open("/Users/shivendraagrawal/Desktop/Training Dataset.csv","rU")
cr = csv.reader(f)
mapping={}
out={}
i=0
for row in cr:
      i=i+1
      mapping[row[0]]=0
      out[row[0]]=0
for row in cr:
      print "hi"
      mapping[row[0]]=mapping[row[0]]+row[5]
      if row[6]=="TRUE":
            out[row[0]]=out[row[0]]+1
for row in cr:
      print mapping[row[0]] +'  '+out[row[0]]
print i   
 
     
     
    