title: python - find specific row attribute with DictReader
body: <p>I want to find specific row with DictReader.</p>
  
  <h3>csv file(test.csv)</h3>
  
  <pre><code>numb, firstname, lastname
  1, yong, kim
  2, gwang, lee
  3, geun, lee 
  ...
  </code></pre>
  
  <h3>.py file</h3>
  
  <pre><code>import csv
  from collections import defaultdict
  from operator import itemgetter
  
  result = {}
  result = defaultdict(lambda: 0, result)
  
  tmp = open('test.csv', 'r')
  file = csv.DictReader(tmp)
  
  # what I want
  print file[1]['firstname'] # =&gt; I want it to be : "gwang"
  </code></pre>
  
  <h1>EDIT</h1>
  
  <p>When I run this code, below error occurs.</p>
  
  <pre><code>Traceback (most recent call last):
    File "****.py", line 23, in &lt;module&gt;
      print file[1]['firstname']
  AttributeError: DictReader instance has no attribute '__getitem__'
  </code></pre>
  
  <p>What should I do?</p>
  
  <p>cheers!</p>