title: CSV File filtering using django(python)
body: <p>Here is an csv file below:</p>
  
  <pre><code>"header1","header2","header3"
  0.051267,0.69956,1
  -0.51325,0.46564,1
  0.085829,-0.75512,0
  0.14919,-0.57968,0
  0.13767,0.57529,1
  -0.0063364,0.39985,1
  -0.092742,0.55336,1
  </code></pre>
  
  <p><strong>I want to pick up the records where column "header 3" equals 0. But I get a KeyError when running line 7.</strong> </p>
  
  <p>Error text:</p>
  
  <pre><code>Request Method: GET
  Request URL:    http://127.0.0.1:8000/filter/
  Django Version: 1.8.3
  Exception Type: KeyError
  Exception Value:2
  Exception Location: C:\Users\antsy\Desktop\datahub-master\view\showdata.py in csv_Filter, line 7
  Python Executable:  C:\Python27\python.exe
  Python Version: 2.7.10
  </code></pre>
  
  <p>Python code:</p>
  
  <pre><code>def csv_Filter(request):
  writer = csv.writer(file(r'test\temp.txt', 'wb'))
  with open(r'test\ex2data2.txt', 'rb') as f:
      reader = csv.DictReader(f)
      writer.writerow(f.read(0))
      for row in reader:
          if row[2] == 0:
              writer.writerow(row)
  reader = file(r'test\temp.txt', 'rb')
  respond = showTable(request, r'test\temp.txt', reader) #another def
  return respond
  </code></pre>