title: Dataquest exercise, my answer was close but won't work. How come?
body: <p>I'm really just here to try and answer why my method didn't work to answer the exercise question.</p>
  
  <p>We were provided a csv file, went through some exercises to extract from it sums of births from each year, day of the week, month, etc. Here is a short head - year, month, day of the month, day of the week, number of births.</p>
  
  <pre><code>[[1994, 1, 1, 6, 8096],
   [1994, 1, 2, 7, 7772],
   [1994, 1, 3, 1, 10142],
   [1994, 1, 4, 2, 11248],
   [1994, 1, 5, 3, 11053]]
  </code></pre>
  
  <p>This last exercise was to generalize our previous exercises so that COLUMN selects a day and FILE could be any CSV file. I know there are many ways to simply import CSVs, but I think they want us to go through the trouble as newbies. lol Anyway, it returns the entire list no matter my input for column. Confusing.</p>
  
  <pre><code>def calc_counts(file, column):
  births_sum = {}
  new = open(file, 'r').read()
  string_list = new.split('\n')[1:]
  final_list = []
  #loop to INT() 
  for row in string_list:
      int_fields = []
      string_fields = row.split(',')
      for value in string_fields:
          int_fields.append(int(value))
      final_list.append(int_fields)
  return final_list     
  for row in final_list:
      births = row[4]
      column_value = final_list[column]
      if column_value in births_sum:
          births_sum[column_value] += births
      else:
          births_sum[column_value] = births
  return births_sum
  </code></pre>
  
  <p>Edit: After some suggestions about removing the first return, this is what I'm receiving -</p>
  
  <pre><code>TypeError: unhashable type: 'list'
  </code></pre>