title: python: unhashable type error
body: <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#80&gt;", line 1, in &lt;module&gt;
      do_work()
    File "C:\pythonwork\readthefile080410.py", line 14, in do_work
      populate_frequency5(e,data)
    File "C:\pythonwork\readthefile080410.py", line 157, in populate_frequency5
      data=medications_minimum3(data,[drug.upper()],1)
    File "C:\pythonwork\readthefile080410.py", line 120, in medications_minimum3
      counter[row[11]]+=1
  TypeError: unhashable type: 'list'
  </code></pre>
  
  <p>I am getting the above error on this line:</p>
  
  <pre><code>data=medications_minimum3(data,[drug.upper()],1)
  </code></pre>
  
  <p>(I have also tried drug.upper() without brackets)</p>
  
  <p>Here is a preview of this function:</p>
  
  <pre><code>def medications_minimum3(c,drug_input,sample_cutoff): #return sample cut off for # medications/physician
    d=[]
    counter=collections.defaultdict(int)
    for row in c:
      counter[row[11]]+=1
    for row in c:
      if counter[row[11]]&gt;=sample_cutoff:
        d.append(row) 
    write_file(d,'/pythonwork/medications_minimum3.csv')
    return d
  </code></pre>
  
  <p>Does anyone know what I am doing wrong here?</p>
  
  <p>I know that what must be wrong is the way I am calling this function, because I call this function from a different location and it works fine:</p>
  
  <pre><code>d=medications_minimum3(c,drug_input,50)
  </code></pre>
  
  <p>Thank you very much for your help!</p>