title: Counting the number of registers by field of a CSV without using Pandas or Numpy
body: <p>I have a CSV file where I have all the registers that I have to manipulate. I have to count the number of registers by age field.<br>
  For example: 31: 6, 32: 5 and so on.<br>
  So I made this to turn the file into a dictionary, but I don't know how to search on the dict by a specific field and the code below is resulting on a error.</p>
  
  <pre class="lang-py prettyprint-override"><code>counter = defaultdict(int)
  with open('file.csv', 'r') as file:
      reader = csv.reader(file)
      for item['age'] in reader:
          counter['age'] += 1
  
  print(counter)
  </code></pre>
  
  <pre class="lang-sh prettyprint-override"><code>NameError: name 'item' is not defined
  </code></pre>
  
  <p><strong>-- Updates --</strong>
  I resolved to change the read to a DictReader. Now my code is like that:</p>
  
  <pre class="lang-py prettyprint-override"><code>counter = defaultdict(int)
  with open('file.csv', 'r') as file:
      reader = csv.DictReader(file)
      for item in reader:
          if(item['age']):
              counter['person ' + str(item['age'])] += 1
  
  print(sorted(counter['age'))
  </code></pre>
  
  <p>But using the sorted function I got a error of <code>TypeError: 'int' object is not iterable</code></p>
  
  <p>I can't use Numpy or Pandas to get the results.</p>